public void Test_AddPublisher_With_Same_CompanyName() { //arrange PublisherService service = new PublisherService(_unitOfWork.Object); PublisherDTO publisher = new PublisherDTO() { CompanyName = "name1", PublisherId = 1}; //act service.AddPublisher(publisher); }
public void Test_GetAll_Return_Right_Nubmber() { //arrange PublisherService service = new PublisherService(_unitOfWork.Object); //act IEnumerable<PublisherDTO> publishers = service.GetAll(); //assert Assert.AreEqual(2, publishers.Count()); }
public void Test_AddPublisher_Call_Insert() { //arrange PublisherService service = new PublisherService(_unitOfWork.Object); PublisherDTO publisher = new PublisherDTO() { CompanyName = "name", PublisherId = 1 }; //act service.AddPublisher(publisher); //assert _publisherRepository.Verify( p => p.Insert(It.IsAny<Publisher>()), Times.Once() ); }
public void Test_GetPublisherByCompanyName_CompanyName_Is_Empty() { //arrange PublisherService service = new PublisherService(_unitOfWork.Object); //act PublisherDTO publisher = service.GetPublisherByCompanyName(""); }
public void Test_GetPublisherByCompanyName_Return_Right_Object() { //arrange PublisherService service = new PublisherService(_unitOfWork.Object); //act PublisherDTO publisher = service.GetPublisherByCompanyName("name1"); //assert Assert.IsNotNull(publisher); Assert.AreEqual(1, publisher.PublisherId); }