예제 #1
0
        public void CanSaveOrUpdateValidRequest()
        {
            // Establish Context
            Request validRequest =
                RequestInstanceFactory.CreateValidTransientRequest();

            WrmsSystem systemToExpect = WrmsSystemInstanceFactory.CreateValidTransientWrmsSystem();

            _wrmsSystemManagementService.Expect(r => r.Get(13))
            .Return(systemToExpect);

            _requestEstimateManagementService.Expect(
                r =>
                r.SaveOrUpdate(new RequestEstimate
            {
                RequestId = validRequest.Id, EstimatedHours = validRequest.EstimatedHours
            })).Return(
                ActionConfirmation.CreateSuccessConfirmation(""));

            // Act
            ActionConfirmation confirmation =
                _requestManagementService.SaveOrUpdate(validRequest);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldNotBeNull();
            confirmation.Value.ShouldEqual(validRequest);
        }
예제 #2
0
        public void CanUpdateWithValidApplicationFromForm()
        {
            // Establish Context
            Application validApplicationFromForm =
                ApplicationInstanceFactory.CreateValidTransientApplication();
            var validPerson = PersonInstanceFactory.CreateValidTransientPerson();

            validApplicationFromForm.LastUpdateUser = 1;
            validPerson.RoleId = 2;

            // Intentionally empty to ensure successful transfer of values
            var applicationFromDb = new Application {
                ApplicationName = "Application Name 1", SupportTeamId = 1
            };

            _personManagementService.Expect(r => r.Get(Arg <int> .Is.Anything)).Return(validPerson);

            _applicationRepository.Expect(r => r.Get(Arg <int> .Is.Anything))
            .Return(applicationFromDb);
            _personManagementService.Expect(r => r.Get(Arg <int> .Is.Anything)).Return(validPerson);

            // Act
            ActionConfirmation confirmation =
                _applicationManagementService.UpdateWith(validApplicationFromForm, 1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldNotBeNull();
            confirmation.Value.ShouldEqual(applicationFromDb);
            confirmation.Value.ShouldEqual(validApplicationFromForm);
        }
예제 #3
0
        public void CannotSaveOrUpdateInvalidAssetContent()
        {
            // Establish Context
            AssetContent invalidAssetContent = new AssetContent();

            // Act
            ActionConfirmation confirmation =
                assetContentManagementService.SaveOrUpdate(invalidAssetContent);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeFalse();
            confirmation.Value.ShouldBeNull();
        }
        public void CannotSaveOrUpdateInvalidChannelsSlide()
        {
            // Establish Context
            ChannelsSlide invalidChannelsSlide = new ChannelsSlide();

            // Act
            ActionConfirmation confirmation =
                channelsSlideManagementService.SaveOrUpdate(invalidChannelsSlide);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeFalse();
            confirmation.Value.ShouldBeNull();
        }
예제 #5
0
        public void CannotSaveOrUpdateInvalidTimeEntry()
        {
            // Establish Context
            var invalidTimeEntry = new TimeEntry();

            // Act
            ActionConfirmation confirmation =
                _timeEntryManagementService.SaveOrUpdate(invalidTimeEntry);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeFalse();
            confirmation.Value.ShouldBeNull();
        }
예제 #6
0
        public void CannotSaveOrUpdateInvalidRSSFeed()
        {
            // Establish Context
            RSSFeed invalidRSSFeed = new RSSFeed();

            // Act
            ActionConfirmation confirmation =
                rSSFeedManagementService.SaveOrUpdate(invalidRSSFeed);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeFalse();
            confirmation.Value.ShouldBeNull();
        }
예제 #7
0
        public void CannotSaveOrUpdateInvalidWrmsSystem()
        {
            // Establish Context
            var invalidWrmsSystem = new WrmsSystem();

            // Act
            ActionConfirmation confirmation =
                _wrmsSystemManagementService.SaveOrUpdate(invalidWrmsSystem);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeFalse();
            confirmation.Value.ShouldBeNull();
        }
예제 #8
0
        public void CannotSaveOrUpdateInvalidSlideFolder()
        {
            // Establish Context
            SlideFolder invalidSlideFolder = new SlideFolder();

            // Act
            ActionConfirmation confirmation =
                slideFolderManagementService.SaveOrUpdate(invalidSlideFolder);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeFalse();
            confirmation.Value.ShouldBeNull();
        }
        public void CannotSaveOrUpdateInvalidRequestType()
        {
            // Establish Context
            var invalidRequestType = new RequestType();

            // Act
            ActionConfirmation confirmation =
                _requestTypeManagementService.SaveOrUpdate(invalidRequestType);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeFalse();
            confirmation.Value.ShouldBeNull();
        }
예제 #10
0
        public void CannotSaveOrUpdateInvalidApplication()
        {
            // Establish Context
            var invalidApplication = new Application();

            // Act
            ActionConfirmation confirmation =
                _applicationManagementService.SaveOrUpdate(invalidApplication);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeFalse();
            confirmation.Value.ShouldBeNull();
        }
예제 #11
0
        public void CannotDeleteNonexistentTimeEntry()
        {
            // Establish Context
            _timeEntryRepository.Expect(r => r.Get(1))
            .Return(null);

            // Act
            ActionConfirmation confirmation =
                _timeEntryManagementService.Delete(1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeFalse();
            confirmation.Value.ShouldBeNull();
        }
예제 #12
0
        public void CanSaveOrUpdateValidWrmsSystem()
        {
            // Establish Context
            WrmsSystem validWrmsSystem =
                WrmsSystemInstanceFactory.CreateValidTransientWrmsSystem();

            // Act
            ActionConfirmation confirmation =
                _wrmsSystemManagementService.SaveOrUpdate(validWrmsSystem);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldNotBeNull();
            confirmation.Value.ShouldEqual(validWrmsSystem);
        }
예제 #13
0
        public void CanSaveOrUpdateValidRSSFeed()
        {
            // Establish Context
            RSSFeed validRSSFeed =
                RSSFeedInstanceFactory.CreateValidTransientRSSFeed();

            // Act
            ActionConfirmation confirmation =
                rSSFeedManagementService.SaveOrUpdate(validRSSFeed);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldNotBeNull();
            confirmation.Value.ShouldEqual(validRSSFeed);
        }
예제 #14
0
        public void CanSaveOrUpdateValidAgency()
        {
            // Establish Context
            Agency validAgency =
                AgencyInstanceFactory.CreateValidTransientAgency();

            // Act
            ActionConfirmation confirmation =
                _agencyManagementService.SaveOrUpdate(validAgency);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldNotBeNull();
            confirmation.Value.ShouldEqual(validAgency);
        }
        public void CanSaveOrUpdateValidPerson()
        {
            // Establish Context
            Person validPerson =
                PersonInstanceFactory.CreateValidTransientPerson();

            // Act
            ActionConfirmation confirmation =
                _personManagementService.SaveOrUpdate(validPerson);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldNotBeNull();
            confirmation.Value.ShouldEqual(validPerson);
        }
예제 #16
0
        public void CanSaveOrUpdateValidSlideFolder()
        {
            // Establish Context
            SlideFolder validSlideFolder =
                SlideFolderInstanceFactory.CreateValidTransientSlideFolder();

            // Act
            ActionConfirmation confirmation =
                slideFolderManagementService.SaveOrUpdate(validSlideFolder);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldNotBeNull();
            confirmation.Value.ShouldEqual(validSlideFolder);
        }
        public void CanSaveOrUpdateValidChannelsSlide()
        {
            // Establish Context
            ChannelsSlide validChannelsSlide =
                ChannelsSlideInstanceFactory.CreateValidTransientChannelsSlide();

            // Act
            ActionConfirmation confirmation =
                channelsSlideManagementService.SaveOrUpdate(validChannelsSlide);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldNotBeNull();
            confirmation.Value.ShouldEqual(validChannelsSlide);
        }
예제 #18
0
        public void CanSaveOrUpdateValidSupportTeam()
        {
            // Establish Context
            SupportTeam validSupportTeam =
                SupportTeamInstanceFactory.CreateValidTransientSupportTeam();

            // Act
            ActionConfirmation confirmation =
                supportTeamManagementService.SaveOrUpdate(validSupportTeam);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldNotBeNull();
            confirmation.Value.ShouldEqual(validSupportTeam);
        }
예제 #19
0
        public void CanSaveOrUpdateValidHost()
        {
            // Establish Context
            Host validHost =
                HostInstanceFactory.CreateValidTransientHost();

            // Act
            ActionConfirmation confirmation =
                _hostManagementService.SaveOrUpdate(validHost);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldNotBeNull();
            confirmation.Value.ShouldEqual(validHost);
        }
        public void CanSaveOrUpdateValidRequestType()
        {
            // Establish Context
            RequestType validRequestType =
                RequestTypeInstanceFactory.CreateValidTransientRequestType();

            // Act
            ActionConfirmation confirmation =
                _requestTypeManagementService.SaveOrUpdate(validRequestType);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldNotBeNull();
            confirmation.Value.ShouldEqual(validRequestType);
        }
예제 #21
0
        public void CanDeleteSlideFolder()
        {
            // Establish Context
            SlideFolder slideFolderToDelete = new SlideFolder();

            slideFolderRepository.Expect(r => r.Get(1))
            .Return(slideFolderToDelete);

            // Act
            ActionConfirmation confirmation =
                slideFolderManagementService.Delete(1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldBeNull();
        }
예제 #22
0
        public void CanDeleteRSSFeed()
        {
            // Establish Context
            RSSFeed rSSFeedToDelete = new RSSFeed();

            rSSFeedRepository.Expect(r => r.Get(1))
            .Return(rSSFeedToDelete);

            // Act
            ActionConfirmation confirmation =
                rSSFeedManagementService.Delete(1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldBeNull();
        }
예제 #23
0
        public void CanDeleteSupportTeam()
        {
            // Establish Context
            var supportTeamToDelete = new SupportTeam();

            supportTeamRepository.Expect(r => r.Get(1))
            .Return(supportTeamToDelete);

            // Act
            ActionConfirmation confirmation =
                supportTeamManagementService.Delete(1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldBeNull();
        }
        public void CanDeletePerson()
        {
            // Establish Context
            var personToDelete = new Person();

            _personRepository.Expect(r => r.Get(1))
            .Return(personToDelete);

            // Act
            ActionConfirmation confirmation =
                _personManagementService.Delete(1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldBeNull();
        }
        public void CanDeleteRequestType()
        {
            // Establish Context
            var requestTypeToDelete = new RequestType();

            _requestTypeRepository.Expect(r => r.Get(1))
            .Return(requestTypeToDelete);

            // Act
            ActionConfirmation confirmation =
                _requestTypeManagementService.Delete(1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldBeNull();
        }
예제 #26
0
        public void CanDeleteWrmsSystem()
        {
            // Establish Context
            var wrmsSystemToDelete = new WrmsSystem();

            _wrmsSystemRepository.Expect(r => r.Get(1))
            .Return(wrmsSystemToDelete);

            // Act
            ActionConfirmation confirmation =
                _wrmsSystemManagementService.Delete(1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldBeNull();
        }
예제 #27
0
        public void CanDeleteAssetContent()
        {
            // Establish Context
            AssetContent assetContentToDelete = new AssetContent();

            assetContentRepository.Expect(r => r.Get(1))
            .Return(assetContentToDelete);

            // Act
            ActionConfirmation confirmation =
                assetContentManagementService.Delete(1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldBeNull();
        }
        public void CanDeleteChannelsSlide()
        {
            // Establish Context
            ChannelsSlide channelsSlideToDelete = new ChannelsSlide();

            channelsSlideRepository.Expect(r => r.Get(1))
            .Return(channelsSlideToDelete);

            // Act
            ActionConfirmation confirmation =
                channelsSlideManagementService.Delete(1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldBeNull();
        }
예제 #29
0
        public void CanDeleteTimeEntry()
        {
            // Establish Context
            var timeEntryToDelete = new TimeEntry();

            _timeEntryRepository.Expect(r => r.Get(1))
            .Return(timeEntryToDelete);

            // Act
            ActionConfirmation confirmation =
                _timeEntryManagementService.Delete(1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldBeNull();
        }
예제 #30
0
        public void CanDeleteTemplate()
        {
            // Establish Context
            Template templateToDelete = new Template();

            templateRepository.Expect(r => r.Get(1))
            .Return(templateToDelete);

            // Act
            ActionConfirmation confirmation =
                templateManagementService.Delete(1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldBeNull();
        }