public void FindIDExisting() { // Arrange ShippingDocumentService service = new ShippingDocumentService(); // Act var doc = service.Create(); var find = service.Find(doc.ID); // Assert Assert.AreEqual(find, doc); }
public void CreateTest() { // Arrange Mock <IShippingDocumentRepository> repositoryMock = new Mock <IShippingDocumentRepository>(); ShippingDocumentService service = new ShippingDocumentService(repositoryMock.Object); // Act var doc = service.Create(); // Assert repositoryMock.Verify(k => k.Insert(doc), Times.Once()); }
public void DeleteExistingDoc() { // Arrange ShippingDocumentService service = new ShippingDocumentService(); // Act var countBefore = service.FindAll().Count; var doc = service.Create(); service.Delete(doc); var countAfter = service.FindAll().Count; // Assert Assert.AreEqual(countBefore, countAfter); }