Beispiel #1
0
        public async Task AppendContextWithFixedConfiguration()
        {
            var guid = Guid.NewGuid().ToString();
            await mTweekApi.AppendContext("test", "append-context-test-1", new Dictionary <string, FSharpUtils.Newtonsoft.JsonValue>()
            {
                ["@fixed:tests/fixed/some_fixed_configuration"] = NewString(guid.ToString())
            });

            var results = await mTweekApi.GetConfigurations("tests/fixed/some_fixed_configuration", new Dictionary <string, string>()
            {
                ["test"] = "append-context-test-1"
            });

            Assert.Equal(guid, results.ToString());
            var additonalGuid = Guid.NewGuid().ToString();
            await mTweekApi.AppendContext("test", "append-context-test-1", new Dictionary <string, FSharpUtils.Newtonsoft.JsonValue>()
            {
                ["@fixed:tests/fixed/additional_fixed_configuration1"] = NewString(additonalGuid),
                ["@fixed:tests/fixed/additional_fixed_configuration2"] = NewString(additonalGuid)
            });

            results = await mTweekApi.GetConfigurations("tests/fixed/_", new Dictionary <string, string>()
            {
                ["test"] = "append-context-test-1"
            });

            Assert.Equal(additonalGuid, results["additional_fixed_configuration1"].ToString());
            Assert.Equal(additonalGuid, results["additional_fixed_configuration2"].ToString());
            Assert.Equal(guid, results["some_fixed_configuration"].ToString());
        }
Beispiel #2
0
 private void Setup()
 {
     mTweekApi.AppendContext("test", "smokeTest1", new Dictionary <string, JsonValue> {
         { "FavoriteFruit", JsonValue.NewString("Banana") },
         { "NickName", JsonValue.NewString("King George") },
         { "Age", JsonValue.NewNumber(50) },
     }).Wait();
 }