public void TestGetProductOptionByIdNotFound() { using (var context = new ProductDbContext(builder.Options)) { SetUpTestData(context); IProductOptionRepository productOptionRepository = new ProductOptionRepository(context); ProductOption po = productOptionRepository.GetById(new Guid()); po.Should().BeNull(); context.Database.EnsureDeleted(); } }
public void TestGetProductOptionByIdOK() { using (var context = new ProductDbContext(builder.Options)) { SetUpTestData(context); IProductOptionRepository productOptionRepository = new ProductOptionRepository(context); ProductOption po = productOptionRepository.GetById(productOptions[0].Id); po.Should().NotBeNull(); po.Id.Should().Equals(productOptions[0].Id); po.Name.Should().Equals(productOptions[0].Name); po.Description.Should().Equals(productOptions[0].Description); po.ProductId.Should().Equals(productOptions[0].ProductId); context.Database.EnsureDeleted(); } }