コード例 #1
0
        public void WhenSitecoreIoCApplicationShutdownsIApplicationApplicationShutdownIsCalled()
        {
            Isolated.Execute(() =>
            {
                //Act
                SitecoreApplication.ApplicationShutdown();

                //Assert
                ApplicationSpy.ApplicationShutdownWasCalled.Should().BeTrue();
            });
        }
コード例 #2
0
        public void WhenSitecoreIoCApplicationStartsIApplicationPreApplicationStartIsCalled()
        {
            Isolated.Execute(() =>
            {
                //Act
                SitecoreApplication.PreApplicationStart();

                //Assert
                ApplicationSpy.PreApplicationStartWasCalled.Should().BeTrue();
            });
        }
コード例 #3
0
        public void Isolated_WhenMoreThanOneApplicationExitsMultipleApplicationFoundThrown()
        {
            //Assign
            var extraAssemblies = new List <Assembly>
            {
                typeof(Application1).Assembly
            };

            //Act
            Action multipleApplications = () =>
                                          Isolated.Execute(SitecoreApplication.PreApplicationStart, extraAssemblies);

            //Assert
            multipleApplications.Should().Throw <MultipleApplicationFound>();
        }