Exemplo n.º 1
0
        public void FillsAllPropetiesFromAppAndCustomJsonConfigsCorrectly()
        {
            // Arrange
            TestMixedConfiguration configuration = new TestMixedConfiguration("customConfig.json");

            // Assert

            // Check all properties filled out from app.config
            configuration.MixedAppString.ShouldBe("mixed-app-string-value");
            configuration.MixedAppBoolean.ShouldBeTrue();
            configuration.MixedAppDecimal.ShouldBe((decimal)7829.2781);
            configuration.MixedAppGuid.ShouldBe(new Guid("0C76271C-BF3E-497E-96E5-840E2EC2FCCB"));
            configuration.MixedAppComplex.ShouldNotBeNull();
            configuration.MixedAppComplex.Id.ShouldBe(new Guid("EDB4B244-85DF-4135-9DE2-126CC30C8B2B"));
            configuration.MixedAppComplex.Name.ShouldBe("mixed-app-name");
            configuration.MixedAppComplex.Amount.ShouldBe((decimal)165.289);

            // Check all properties filled out from config.json
            configuration.MixedJsonString.ShouldBe("mixed-custom-json-string-value");
            configuration.MixedJsonBoolean.ShouldBeTrue();
            configuration.MixedJsonDecimal.ShouldBe((decimal)7829.2980);
            configuration.MixedJsonGuid.ShouldBe(new Guid("73AD6DC7-4865-441B-A84C-C2D6ED6D0E7D"));
            configuration.MixedJsonComplex.ShouldNotBeNull();
            configuration.MixedJsonComplex.Id.ShouldBe(new Guid("E62BB5BD-1800-4031-95B7-041C91384C0D"));
            configuration.MixedJsonComplex.Name.ShouldBe("mixed-custom-json-name");
            configuration.MixedJsonComplex.Amount.ShouldBe((decimal)9102.26783);
        }
Exemplo n.º 2
0
        public void FillsAllPropetiesFromAppAndJsonConfigsCorrectly()
        {
            // Arrange
            TestMixedConfiguration configuration = new TestMixedConfiguration();

            // Assert

            // Check all properties filled out from app.config
            configuration.MixedAppString.ShouldBe("mixed-app-string-value");
            configuration.MixedAppBoolean.ShouldBeTrue();
            configuration.MixedAppDecimal.ShouldBe((decimal)7829.2781);
            configuration.MixedAppGuid.ShouldBe(new Guid("0C76271C-BF3E-497E-96E5-840E2EC2FCCB"));
            configuration.MixedAppComplex.ShouldNotBeNull();
            configuration.MixedAppComplex.Id.ShouldBe(new Guid("EDB4B244-85DF-4135-9DE2-126CC30C8B2B"));
            configuration.MixedAppComplex.Name.ShouldBe("mixed-app-name");
            configuration.MixedAppComplex.Amount.ShouldBe((decimal)165.289);

            // Check all properties filled out from config.json
            configuration.MixedJsonString.ShouldBe("mixed-json-string-value");
            configuration.MixedJsonBoolean.ShouldBeFalse();
            configuration.MixedJsonDecimal.ShouldBe((decimal)21768.2893);
            configuration.MixedJsonGuid.ShouldBe(new Guid("5F86032B-6F9A-4114-93D3-40AED21972E1"));
            configuration.MixedJsonComplex.ShouldNotBeNull();
            configuration.MixedJsonComplex.Id.ShouldBe(new Guid("9B0B59CF-758C-42E3-9BD0-BB1E8853A750"));
            configuration.MixedJsonComplex.Name.ShouldBe("mixed-json-name");
            configuration.MixedJsonComplex.Amount.ShouldBe((decimal)2678.18792);
        }