Esempio n. 1
0
        private void AssertStaffEventCreation(Staff staff, LookupValueRepositoryFixture lookupValueRepository)
        {
            Assert.IsTrue(staff.StaffEvents.Count() == 2);

            staff.StaffEvents.ForEach(
                se =>
                Assert.IsTrue(lookupValueRepository.GetAllStaffEventTypes().Any(allStaffEvents => allStaffEvents.Name == se.StaffEventType.Name)));
        }
Esempio n. 2
0
        private void AssertStaffChecklistCreation(Staff staff, LookupValueRepositoryFixture lookupValueRepository)
        {
            Assert.IsTrue(staff.StaffChecklist.Count() == 2);

            staff.StaffChecklist.ForEach(
                sc =>
            {
                Assert.IsTrue(
                    lookupValueRepository.GetAllStaffChecklistItemTypes().Any(allSc => allSc.Name == sc.StaffChecklistItemType.Name));
                Assert.IsTrue(!sc.CheckedIndicator);
            });
        }
Esempio n. 3
0
        public void CreateStaff_GivenValidArguments_StaffChecklistIsCreated()
        {
            using (var serviceLocatorFixture = new ServiceLocatorFixture())
            {
                // Setup
                var staffRepository       = new Mock <IStaffRepository>();
                var lookupValueRepository = new LookupValueRepositoryFixture();

                var staffFactory = new StaffFactory(staffRepository.Object, lookupValueRepository);

                var agency = new Mock <Agency>();

                StaffProfile staffProfile =
                    new StaffProfileBuilder().WithStaffName(new PersonNameBuilder().WithFirst("Fred").WithLast("Smith"));

                var staff = staffFactory.CreateStaff(agency.Object, staffProfile);

                AssertStaffChecklistCreation(staff, lookupValueRepository);
            }
        }