public void Should_camel_case_value()
        {
            const string script = @"
                return toCamelCase(value);
            ";

            var vars = new ScriptVars
            {
                ["value"] = "Hello World"
            };

            var result = sut.Interpolate(vars, script);

            Assert.Equal("helloWorld", result);
        }
Пример #2
0
        public void Should_reset_counter()
        {
            var appId = Guid.NewGuid();

            A.CallTo(() => grainFactory.GetGrain <ICounterGrain>(appId, null))
            .Returns(counter);

            A.CallTo(() => counter.ResetAsync("my", 4))
            .Returns(3);

            const string script = @"
                return resetCounter('my', 4);
            ";

            var context = new ScriptVars
            {
                ["appId"] = appId
            };

            var result = sut.Interpolate(context, script);

            Assert.Equal("3", result);
        }