public OrderDetailTests() { _orderDetail = new OrderDetail(); var fixture = new OmitRecursionFixture(); _shopItem = fixture.Create <ShopItem>(); _order = fixture.Create <Order>(); }
public ShopItemTests() { _shopItem = new ShopItem(); var fixture = new OmitRecursionFixture(); _category = fixture.Create <Category>(); fixture.Freeze <ShopItem>(); _shopItemLeft = fixture.Create <ShopItem>(); _shopItemRight = fixture.Create <ShopItem>(); }
public OrderTests() { var fixture = new OmitRecursionFixture(); _orderDetails = fixture.CreateMany <OrderDetail>().ToList(); _customer = fixture.Create <Customer>(); _orderPlaced = fixture.Create <DateTime>(); _order = new Order(); }
public CategoryTests() { _category = new Category(); var fixture = new OmitRecursionFixture(); _shopItems = fixture.CreateMany <ShopItem>().ToList(); fixture.Freeze <Category>(); _categoryLeft = fixture.Create <Category>(); _categoryRight = fixture.Create <Category>(); }
public void TestToHtmlShouldReturnHtmlStringWithOrderValues() { //Arrange var fixture = new OmitRecursionFixture(); var sut = fixture.Create <Order>(); //Act var result = sut.ToHtmlMessage(); //Assert Assert.NotNull(result); Assert.StartsWith("<html>", result); Assert.Contains(sut.Id.ToString(), result); Assert.Contains(sut.OrderPlaced.ToString(CultureInfo.CurrentCulture), result); foreach (var orderDetail in sut.OrderDetails) { Assert.Contains(orderDetail.ShopItem.Name, result); Assert.Contains(orderDetail.Amount.ToString(), result); Assert.Contains((orderDetail.Price * orderDetail.Amount).ToString("C"), result); } Assert.Contains(sut.OrderTotal.ToString("C"), result); Assert.EndsWith("</html>", result); }