Ejemplo n.º 1
0
        public void GetSettings_ReturnsDevelopment_WhenIsDevAndNotProd()
        {
            RuntimeSetting expected = RuntimeSetting.Development;

            using (AutoMock mock = AutoMock.GetLoose()) {
                mock.Mock <IRuntimeEnvProvider> ()
                .Setup(x => x.IsDevEnv())
                .Returns(true);
                mock.Mock <IRuntimeEnvProvider> ()
                .Setup(x => x.IsProdEnv())
                .Returns(false);

                RecipeApiEnv   sut    = mock.Create <RecipeApiEnv> ();
                RuntimeSetting actual = sut.GetSettings();

                Assert.Equal(expected, actual);
            }
        }
Ejemplo n.º 2
0
        private RuntimeSetting GetRuntimeSetting()
        {
            RecipeApiEnv apiEnv = new RecipeApiEnv(new RuntimeEnvProviderImpl(_configuration));

            return(apiEnv.GetSettings());
        }