コード例 #1
0
        public void EnvironmentNameMustNotCallGetEnvironmentNameOnceEnvironmentNameHasBeenDetermined()
        {
            MockRuntimeContext context = new MockRuntimeContext();

            Assert.Equal(string.Empty, context.EnvironmentName);
            int expected = context.GetEnvironmentNameCalled;

            Assert.Equal(string.Empty, context.EnvironmentName);
            Assert.Equal(expected, context.GetEnvironmentNameCalled);
        }
コード例 #2
0
        public void ApplicationNameMustNotCallGetApplicationNameOnceApplicationNameHasBeenDetermined()
        {
            MockRuntimeContext context = new MockRuntimeContext();

            Assert.Equal(AppDomain.CurrentDomain.FriendlyName, context.ApplicationName);
            int expected = context.GetApplicationNameCalled;

            Assert.Equal(AppDomain.CurrentDomain.FriendlyName, context.ApplicationName);
            Assert.Equal(expected, context.GetApplicationNameCalled);
        }