public void Should_Get_Product_By_Id_Without_Given_Context() { var repo = new ProductRepository(); var product = repo.Get(1); Assert.IsNotNull(product); Assert.AreEqual(1, product.ProductId); }
public void Should_Geted_Product_By_Same_Id_With_And_Without_Given_Context_Be_Equal() { var context = new ProductContext(); var repo = new ProductRepository(context); var product1 = repo.Get(1); var product2 = repo.Get(1); Assert.AreSame(product1,product2); }
public void Should_Get_Product_By_Id() { var context = new ProductContext(); var repo = new ProductRepository(context); var logger = new EntLibLogger(null); //Assert.IsNotNull(product); //Assert.AreEqual(1,product.ProductId); var service = new ProductService(repo,logger); var product = service.GetProduct(316); Assert.IsNotNull(product); Assert.AreEqual("Blade", product.Name); }