public void Test_Simple() { Test(() => { var res = _ConverTOJSO.Map(_Test).JSValue; res.Should().NotBeNull(); var res1 = res.GetValue("S1"); res1.Should().NotBeNull(); res1.Convert().IsString.Should().BeTrue(); var res2 = res.GetValue("I1"); res2.Should().NotBeNull(); res2.Convert().IsInt.Should().BeTrue(); }); }
public void Test_Simple() { JSObject res = _ConverTOJSO.Map(_Test).JSValue; res.Should().NotBeNull(); var res1 = res["S1"]; res1.Should().NotBeNull(); res1.IsString.Should().BeTrue(); var res2 = res["I1"]; res2.Should().NotBeNull(); res2.IsNumber.Should().BeTrue(); }
public void Test_DateTime_FromCSharp() { using (Tester()) { Init(); var mapped = _ConverTOJSO.Map(new DateTime(1974, 2, 26)); mapped.Type.Should().Be(JSCSGlueType.Basic); JSObject date = mapped.JSValue; date.Should().NotBeNull(); int year = this._WebView.EvaluateSafe(() => GetYear(date)); year.Should().Be(1974); int month = this._WebView.EvaluateSafe(() => (int)date.Invoke("getMonth", null)); month.Should().Be(1); int day = this._WebView.EvaluateSafe(() => (int)date.Invoke("getDate", null)); day.Should().Be(26); } }