mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-03-31 18:38:22 +00:00
comparision test brought here
This commit is contained in:
31
Tests/Distribution/MyResource.cs
Normal file
31
Tests/Distribution/MyResource.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Esiur.Core;
|
||||
using Esiur.Resource;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
namespace Esiur.Tests.Distribution;
|
||||
|
||||
[Resource]
|
||||
[Annotation("A", "B")]
|
||||
public partial class MyResource
|
||||
{
|
||||
[Export][Annotation("Comment")] string description;
|
||||
[Export] int categoryId;
|
||||
|
||||
[Export] public string Hello() => "Hi";
|
||||
|
||||
[Export] public string HelloParent() => "Hi from Parent";
|
||||
|
||||
[Export]
|
||||
[Annotation("This function computes the standard deviation of a list")]
|
||||
public double StDev(double[] values)
|
||||
{
|
||||
double avg = values.Average();
|
||||
return Math.Sqrt(values.Average(v => Math.Pow(v - avg, 2)));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user