Exemplo n.º 1
0
        public void CheckResolveValue(Resolver resolver, string input, string expect)
        {
            Resolver.AddResolver("test", resolver);

            try
            {
                string?result = Resolver.Resolve(input);
                Assert.Equal(expect, result);
            }
            finally
            {
                Resolver.RemoveResolver("test");
            }
        }
Exemplo n.º 2
0
        public void TestResolvingString(Resolver resolver, string input, string expect)
        {
            Resolver.AddResolver("test", resolver);

            try
            {
                ResolvingString rs     = input;
                string?         result = rs;
                Assert.Equal(expect, result);
            }
            finally
            {
                Resolver.RemoveResolver("test");
            }
        }
Exemplo n.º 3
0
        public void TestResolvingStringIsLive()
        {
            Resolver.AddResolver("test", Resolver1);

            try
            {
                ResolvingString rs = "${test:changing}";

                Resolver1.Values["changing"] = "first value";
                string?result1 = rs;
                Assert.Equal("first value", result1);

                Resolver1.Values["changing"] = "updated value";
                string?result2 = rs;
                Assert.Equal("updated value", result2);
            }
            finally
            {
                Resolver.RemoveResolver("test");
            }
        }