private void TestInputForTotalsTest(StockService service) { service.CreateNewStock(StockType.Bond, 10, 2); service.CreateNewStock(StockType.Equity, 10, 2); service.CreateNewStock(StockType.Equity, 10, 2); service.CreateNewStock(StockType.Bond, 10, 2); service.CreateNewStock(StockType.Bond, 10, 2); }
public void TestNameEquityBond() { var service = new StockService(); var stock1 = service.CreateNewStock(StockType.Equity, 1, 1); var stock2 = service.CreateNewStock(StockType.Bond, 1, 1); Assert.AreEqual("Equity1", stock1.Name); Assert.AreEqual("Bond1", stock2.Name); }
public void TestStockWeight() { var service = new StockService(); service.CreateNewStock(StockType.Bond, 2.0M, 10); service.CreateNewStock(StockType.Bond, 25.0M, 2); service.CreateNewStock(StockType.Bond, 6.0M, 5); var dtos = service.ListDTO(); Assert.AreEqual(20, dtos[0].StockWeight); Assert.AreEqual(50, dtos[1].StockWeight); Assert.AreEqual(30, dtos[2].StockWeight); }
public void CanCreateStock() { var service = new StockService(); service.CreateNewStock(StockType.Bond, 1, 1); Assert.AreEqual(1, service.Count()); }
public void TestNameBond() { var service = new StockService(); var stock = service.CreateNewStock(StockType.Bond, 1, 1); Assert.AreEqual("Bond1", stock.Name); }
public void TestNameEquity() { var service = new StockService(); var stock = service.CreateNewStock(StockType.Equity, 1, 1); Assert.AreEqual("Equity1", stock.Name); }
public void CanGetDTOAfterCreateNew() { var service = new StockService(); service.CreateNewStock(StockType.Bond, 1, 1); var dto = service.GetDTO(1); Assert.IsNotNull(dto); }
public void CanListAfterInsert() { var service = new StockService(); service.CreateNewStock(StockType.Bond, 1, 1); var list = service.ListDTO(); Assert.AreEqual(1, list.Count); }
public void TestIfShouldHighlight(StockType type, double price, int quantity, bool highlight) { var service = new StockService(); service.CreateNewStock(type, (decimal)price, quantity); var dto = service.GetDTO(1); Assert.AreEqual(highlight, dto.Highlight); }
public void TestTransactionCost(StockType type, double price, int quantity, double expectedTransactionCost) { var service = new StockService(); service.CreateNewStock(type, (decimal)price, quantity); var dto = service.GetDTO(1); Assert.AreEqual((decimal)expectedTransactionCost, dto.TransactionCost); }