コード例 #1
0
        public void SerialiseSimpleObject()
        {
            var simpleObject = new SimpleObject {
                Integer = 3, SomeString = "test"
            };

            var model = simpleObject.ToKO();

            model.ToJavascriptObject(ObjectName).Simplify().Should().BeInObject(ObjectName, "this.integer: ko.observable(3);this.someString: ko.observable('test');");
        }
コード例 #2
0
        public void SerialiseSimpleObject()
        {
            var simpleObject = new SimpleObject {
                Integer = 3, SomeString = "test"
            };

            var model = simpleObject.ToKO();

            model.ToJavascript().Simplify().Should().Be("{integer: ko.observable(3), someString: ko.observable('test')}");
        }