-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bc1cc1
commit 1d6e355
Showing
4 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
global using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
global using Microsoft.VisualStudio.TestTools.UnitTesting; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace StaticSeries; | ||
|
||
public partial class Sma : StaticSeriesTestBase | ||
{ | ||
[TestMethod] | ||
public void Average() | ||
{ | ||
QuotePart[] results = new[] | ||
{ | ||
new QuotePart(Quotes[0].Timestamp, 0.0), | ||
new QuotePart(Quotes[1].Timestamp, 4.0), | ||
new QuotePart(Quotes[2].Timestamp, 8.0) | ||
}; | ||
|
||
// sut | ||
double? mid = results.Average(2, 1); | ||
double? end = results.Average(2); | ||
|
||
// assert | ||
mid.Should().Be(2); | ||
end.Should().Be(6); | ||
} | ||
} |