public void GetAll_ShouldReturn_NonNull_ListOf_SwagDTO() { //Act ISwagService service = new SwagService(); IList<SwagDTO> swags = service.GetAll(); //Assert swags.ShouldNotBeNull("Expected Not Null"); Assert.IsInstanceOfType(swags, typeof (IList<SwagDTO>)); }
public void GetAll_ShouldReturn_NonNull_ListOf_SwagDTO() { //Arrange _mockDomain.Expect(x => x.GetAll()).Return(new List<SwagDTO>()).Repeat.Once(); _mockRepository.ReplayAll(); //Act ISwagService service = new SwagService(_mockDomain); IList<SwagDTO> swags = service.GetAll(); //Assert _mockRepository.VerifyAll(); swags.ShouldNotBeNull("Expected Not Null"); Assert.IsInstanceOfType(swags, typeof (IList<SwagDTO>)); }
public void Insert_ShouldReturn_NonNull_Boolean() { using (new TransactionScope()) { //Arrange long attendeeID = new AttendeeService().GetAll()[0].AttendeeID; long sponsorID = new SponsorService().GetAllThatProvidedSwag()[0].SponsorID; long swagID = new SwagService().GetAllBySponsor(sponsorID)[0].SwagID; //Act IWinnerService service = new WinnerService(); bool result = service.Insert(new WinnerDTO {AttendeeID = attendeeID, SponsorID = sponsorID, SwagID = swagID, Name = "Big Winner",}); //Assert Assert.IsInstanceOfType(result, typeof (bool)); } }