コード例 #1
0
ファイル: AttendeeTests.cs プロジェクト: kburnell/PickAWinner
 public void InsertAll_ShouldReturn_NonNull_Boolean()
 {
     //Arrange
     IList<AttendeeDTO> attendeeDtos = new List<AttendeeDTO> { new AttendeeDTO { FirstName = "FName", LastName = "LName", Company = "Company", Email = "*****@*****.**", IsEligible = true, HasWon = true } };
     using (new TransactionScope()) {
         //Act
         IAttendee attendee = new Attendee();
         bool returnSuccess = attendee.InsertAll(attendeeDtos);
         //Assert
         Assert.IsInstanceOfType(returnSuccess, typeof(bool));
     }
 }
コード例 #2
0
ファイル: AttendeeTests.cs プロジェクト: kburnell/PickAWinner
 public void InsertsAll_ShouldReturn_NonNull_Boolean()
 {
     //Arrange
     const bool success = true;
     _mockRepo.Expect(x => x.InsertAll(new List<AttendeeDTO>())).IgnoreArguments().Return(success).Repeat.Once();
     _mockRepository.ReplayAll();
     //Act
     IAttendee attendee = new Attendee(_mockRepo);
     bool returnSuccess = attendee.InsertAll(new List<AttendeeDTO>());
     //Assert
     _mockRepository.VerifyAll();
     Assert.IsInstanceOfType(returnSuccess, typeof(bool));
 }