Ejemplo n.º 1
0
        public void WhenDisasterIsNotFoundThrowArgumentException()
        {
            var underTst = new AdminService(mockService.Object);

            initializeDisasterCollection(disasterWithCommitments);
            initializeVolunteerCollection(personWithCommitments);
            initializeCommitmentCollection(commitment);

            var disaster = new Disaster
            {
                Id = -1,
                Name = "DoesNotExist"
            };
            underTst.GetVolunteers(disaster);
        }
Ejemplo n.º 2
0
        public void WhenVolunteersExistForMultipleDisastersReturnCorrectDisaster()
        {
            initializeDisasterCollection(disasterWithCommitments, disasterWithNoCommitments);
            initializeVolunteerCollection(personWithCommitments, personWithNoCommitments);

            var secondCommitment = new Commitment
            {
                DisasterId = disasterWithNoVolunteersID,
                Id = 102,
                PersonId = personWithNoCommitmentsID,
                StartDate = new DateTime(2013, 8, 15),
                EndDate = new DateTime(2013, 8, 20)
            };
            initializeCommitmentCollection(commitment, secondCommitment);

            var underTest = new AdminService(mockService.Object);

            var result = underTest.GetVolunteers(disasterWithCommitments);

            Assert.AreEqual(1, result.Count());
        }
Ejemplo n.º 3
0
        public void WhenVolunteerDontCommitReturnCommittedRecords()
        {
            initializeDisasterCollection(disasterWithCommitments);
            initializeVolunteerCollection(personWithCommitments, personWithNoCommitments);
            initializeCommitmentCollection(commitment);

            var underTest = new AdminService(mockService.Object);

            var result = underTest.GetVolunteers(disasterWithCommitments);

            Assert.AreEqual(1, result.Count());
        }
Ejemplo n.º 4
0
        public void WhenOneVolunteerHasRegisteredReturnThatOneRecord()
        {
            initializeDisasterCollection(disasterWithCommitments);
            initializeVolunteerCollection(personWithCommitments);
            initializeCommitmentCollection(commitment);

            var underTest = new AdminService(mockService.Object);

            var result = underTest.GetVolunteers(disasterWithCommitments);

            Assert.AreEqual(1, result.Count());
        }
Ejemplo n.º 5
0
        public void WhenNoVolunteersAreRegisteredReturnAnEmptyList()
        {
            var underTest = new AdminService(mockService.Object);

            initializeDisasterCollection(disasterWithNoCommitments);

            var result = underTest.GetVolunteers(disasterWithNoCommitments);
            Assert.IsFalse(result.Any());
        }
Ejemplo n.º 6
0
 public void WhenDisasterIsNullThrowNullArgumentException()
 {
     var underTest = new AdminService(mockService.Object);
     var result = underTest.GetVolunteers(default(Disaster));
 }