public void ThatBrandCanBeFoundWhenCreated() { var brand = BrandServices.WithDto(BrandTestFixtures.GetDto()).Get(); Assert.AreEqual(brand, BrandServices.Brands.Single(b => b.Name == brand.Name)); }
public void ThatBrandCanBeDeleted() { var brand = BrandServices.WithDto(BrandTestFixtures.GetDto()).Get(); Assert.AreEqual(brand, BrandServices.Brands.Single(b => b.Name == brand.Name)); BrandServices.Delete(brand); brand = BrandServices.Brands.FirstOrDefault(b => b.Name == BrandTestFixtures.GetDto().Name); Assert.IsNull(brand); }
public void ThatBrandCanBeUpdated() { var brand = BrandServices.WithDto(BrandTestFixtures.GetDto()).Get(); BrandServices.ChangeBrandName(brand, "changedName"); Context.CurrentSession().Transaction.Commit(); Context.CurrentSession().Transaction.Begin(); brand = BrandServices.Brands.FirstOrDefault(b => b.Name == BrandTestFixtures.GetDto().Name); Assert.IsNull(brand); }
public void ThatVersionDoesNotChangedAfterOnlyAReadAction() { var services = BrandServices.WithDto(BrandTestFixtures.GetDto()).Get(); Assert.AreEqual(1, services.Version); Context.CurrentSession().Transaction.Commit(); Context.CurrentSession().Transaction.Begin(); var brand = BrandServices.Brands.Single(x => x.Name == BrandTestFixtures.GetDto().Name); Assert.AreEqual(1, brand.Version); }
public void ThatBrandCanBeFoundByName() { var brand = BrandServices.WithDto(BrandTestFixtures.GetDto()).Get(); Assert.AreEqual(brand, BrandServices.GetByName(brand.Name)); }
public void ThatBrandHasAnId() { var brand = BrandServices.WithDto(BrandTestFixtures.GetDto()).Get(); Assert.IsTrue(brand.Id != Guid.Empty); }
public void ThatABrandCanBeGet() { var brand = BrandServices.WithDto(BrandTestFixtures.GetDto()).Get(); Assert.IsNotNull(brand); }
public void ThatBrandWithNoProductsHasEmptyProductList() { var brand = BrandServices.WithDto(BrandTestFixtures.GetDto()).Get(); Assert.AreEqual(0, brand.Products.Count()); }