public void Add_WhenTwoValueAddedWithTheSameValue_LastEmaValueIsTheSameAsOriginalValue() { var target = new Ema(10); target.Add(10m); target.Add(10m); target.Values.LastOrDefault().ShouldBeEquivalentTo(10m); }
public void Add_WhenTwoValueAddedWithDifferentValue_LastEmaValueIsTheAverage() { var target = new Ema(10); target.Add(0m); target.Add(10m); target.Values.LastOrDefault().Should().BeApproximately((180m) / 99m, 0.000000001m); target.Values.FirstOrDefault().ShouldBeEquivalentTo(0); }