Example #1
0
        public void LoadFromAppConfig_should_return_valid_session_after_checking_specified_assembly()
        {
            using (new IndirectionsContext())
            {
                // Arrange
                var myConfiguration = new MyConfiguration();
                myConfiguration.Assembly = typeof(object).Assembly.FullName;

                var assemblyMock = new PAssemblyMock();
                assemblyMock.SetupLoadString(myConfiguration.Assembly);

                var configurationManagerMock = new PConfigurationManagerMock();
                configurationManagerMock.SetupGetSectionString("my");


                // Act
                var section = myConfiguration.LoadFromAppConfig();


                // Assert
                assemblyMock.VerifyLoadString();
                configurationManagerMock.VerifyGetSectionString();
                Assert.IsNotNull(section);
            }
        }