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);
        }
        public void CanGetChannelsSlide()
        {
            // Establish Context
            ChannelsSlide channelsSlideToExpect =
                ChannelsSlideInstanceFactory.CreateValidTransientChannelsSlide();

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

            // Act
            ChannelsSlide channelsSlideRetrieved =
                channelsSlideManagementService.Get(1);

            // Assert
            channelsSlideRetrieved.ShouldNotBeNull();
            channelsSlideRetrieved.ShouldEqual(channelsSlideToExpect);
        }
        public void CanShowChannelsSlide()
        {
            // Establish Context
            ChannelsSlide channelsSlide =
                ChannelsSlideInstanceFactory.CreateValidTransientChannelsSlide();

            channelsSlideManagementService.Expect(r => r.Get(1))
            .Return(channelsSlide);

            // Act
            ViewResult result = channelsSlidesController.Show(1).AssertViewRendered();

            // Assert
            result.ViewData.Model.ShouldNotBeNull();
            (result.ViewData.Model as ChannelsSlide).ShouldNotBeNull();
            (result.ViewData.Model as ChannelsSlide).ShouldEqual(channelsSlide);
        }
        public void CanCreateFormViewModelForChannelsSlide()
        {
            // Establish Context
            ChannelsSlideFormViewModel viewModelToExpect = new ChannelsSlideFormViewModel();

            ChannelsSlide channelsSlide =
                ChannelsSlideInstanceFactory.CreateValidTransientChannelsSlide();

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

            // Act
            ChannelsSlideFormViewModel viewModelRetrieved =
                channelsSlideManagementService.CreateFormViewModelFor(1);

            // Assert
            viewModelRetrieved.ShouldNotBeNull();
            viewModelRetrieved.ChannelsSlide.ShouldNotBeNull();
            viewModelRetrieved.ChannelsSlide.ShouldEqual(channelsSlide);
        }
        public void CanGetAllChannelsSlides()
        {
            // Establish Context
            IList <ChannelsSlide> channelsSlidesToExpect = new List <ChannelsSlide>();

            ChannelsSlide channelsSlide =
                ChannelsSlideInstanceFactory.CreateValidTransientChannelsSlide();

            channelsSlidesToExpect.Add(channelsSlide);

            channelsSlideRepository.Expect(r => r.GetAll())
            .Return(channelsSlidesToExpect);

            // Act
            IList <ChannelsSlide> channelsSlidesRetrieved =
                channelsSlideManagementService.GetAll();

            // Assert
            channelsSlidesRetrieved.ShouldNotBeNull();
            channelsSlidesRetrieved.Count.ShouldEqual(1);
            channelsSlidesRetrieved[0].ShouldNotBeNull();
            channelsSlidesRetrieved[0].ShouldEqual(channelsSlide);
        }
        public void CanUpdateWithValidChannelsSlideFromForm()
        {
            // Establish Context
            ChannelsSlide validChannelsSlideFromForm =
                ChannelsSlideInstanceFactory.CreateValidTransientChannelsSlide();

            // Intentionally empty to ensure successful transfer of values
            ChannelsSlide channelsSlideFromDb = new ChannelsSlide();

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

            // Act
            ActionConfirmation confirmation =
                channelsSlideManagementService.UpdateWith(validChannelsSlideFromForm, 1);

            // Assert
            confirmation.ShouldNotBeNull();
            confirmation.WasSuccessful.ShouldBeTrue();
            confirmation.Value.ShouldNotBeNull();
            confirmation.Value.ShouldEqual(channelsSlideFromDb);
            confirmation.Value.ShouldEqual(validChannelsSlideFromForm);
        }