public void T3() { // Arrange var tradeManager = new TradeManager(); tradeManager.AddNewTrade(TestTradeDetailsViewModel); tradeManager.AddNewTrade(TestTradeDetailsViewModel); tradeManager.AddNewTrade(TestTradeDetailsViewModel); tradeManager.ClearAll(); // Act var actual = tradeManager.GetDateRange(); // Assert Assert.Equal((DateTime.MaxValue, DateTime.MinValue), actual); }
public void T2() { // Arrange var tradeManager = new TradeManager(); tradeManager.AddNewTrade(TestTradeDetailsViewModel); tradeManager.AddNewTrade(TestTradeDetailsViewModel); tradeManager.AddNewTrade(TestTradeDetailsViewModel); tradeManager.ClearAll(); // Act tradeManager.FilterTrades(TestFilters); // Assert Assert.Empty(tradeManager.Trades); }
public void T2() { // Arrange var tradeManager = new TradeManager { Filters = TestFilters }; var tradeDetails = TestTradeDetailsViewModel; var testDate = new DateTime(2021, 1, 2); tradeDetails.Open.Date = testDate; tradeManager.AddNewTrade(tradeDetails); tradeDetails.Open.Date = new DateTime(2021, 1, 3); // Act tradeManager.AddNewTrade(tradeDetails); // Assert Assert.Equal(testDate, tradeManager.GetDateRange().Item1); }
public void T6() { // Arrange var tradeManager = new TradeManager { Filters = TestFilters }; var tradeDetails = TestTradeDetailsViewModel; tradeDetails.Open.Date = new DateTime(2021, 1, 2); tradeManager.AddNewTrade(tradeDetails); var catcher = Catcher.Simple; tradeManager.DateRangeChanged += catcher.Catch; // Act tradeManager.AddNewTrade(tradeDetails); // Assert catcher.DidNotCatch(); }
public void T0() { // Arrange var tradeManager = new TradeManager { Filters = TestFilters }; // Act tradeManager.AddNewTrade(TestTradeDetailsViewModel); // Assert Assert.NotEmpty(tradeManager.Trades); }
public void T5() { // Arrange var tradeDetails = TestTradeDetailsViewModel; tradeDetails.CloseLevel = Option.None <double>(); var tradeManager = new TradeManager { Filters = TestFilters }; // Act tradeManager.AddNewTrade(tradeDetails); // Assert Assert.IsType <Option.OptionNone <Execution> >(tradeManager.Trades[0].Close); }
public void T4() { // Arrange var tradeDetails = TestTradeDetailsViewModel; const double testOpenSize = 19.6; tradeDetails.Open.Size = testOpenSize; var tradeManager = new TradeManager { Filters = TestFilters }; // Act tradeManager.AddNewTrade(tradeDetails); // Assert Assert.Equal(testOpenSize, tradeManager.Trades[0].Open.Size); }
public void T3() { // Arrange var tradeDetails = TestTradeDetailsViewModel; const double testLevelEntry = 123.00; tradeDetails.Levels.Entry = testLevelEntry; var tradeManager = new TradeManager { Filters = TestFilters }; // Act tradeManager.AddNewTrade(tradeDetails); // Assert Assert.Equal(testLevelEntry, tradeManager.Trades[0].Levels.Entry); }
public void T2() { // Arrange var tradeDetails = TestTradeDetailsViewModel; var testStrategy = new Strategy("Triangle"); tradeDetails.SelectedStrategy = testStrategy; var tradeManager = new TradeManager { Filters = TestFilters }; // Act tradeManager.AddNewTrade(tradeDetails); // Assert Assert.Equal(testStrategy, tradeManager.Trades[0].Strategy); }
public void T1() { // Arrange var tradeDetails = TestTradeDetailsViewModel; var testMarket = new Market("USDJPY", AssetClass.Currencies, PipDivisor.One); tradeDetails.SelectedMarket = testMarket; var tradeManager = new TradeManager { Filters = TestFilters }; // Act tradeManager.AddNewTrade(tradeDetails); // Assert Assert.Equal(testMarket, tradeManager.Trades[0].Market); }
public void T8() { // Arrange var tradeDetails = TestTradeDetailsViewModel; const double testLow = 93.8; tradeDetails.Low = Option.Some(testLow); var tradeManager = new TradeManager { Filters = TestFilters }; var outValue = 1.00; // Act tradeManager.AddNewTrade(tradeDetails); // Assert tradeManager.Trades[0].Low.IfExistsThen(x => { outValue = x; }); Assert.Equal(testLow, outValue); }
public void T6() { // Arrange var tradeDetails = TestTradeDetailsViewModel; const double testCloseLevel = 456.78; tradeDetails.CloseLevel = Option.Some(testCloseLevel); var tradeManager = new TradeManager { Filters = TestFilters }; var outValue = 1.00; // Act tradeManager.AddNewTrade(tradeDetails); // Assert tradeManager.Trades[0].Close.IfExistsThen(x => { outValue = x.Level; }); Assert.Equal(testCloseLevel, outValue); }