Exemple #1
0
        public void GetJavaScript()
        {
            SetupElementProperties(typeof(JavaScript));
            string     expectedString        = "javascript";
            JavaScript expected              = new JavaScript(expectedString);
            TestResults <JavaScript> results =
                new TestResults <JavaScript>(
                    _logger.Object,
                    _flowData.Object.Pipeline,
                    _engine.Object,
                    _missingPropertyService.Object,
                    expectedString);

            var value = results[_testPropertyName];

            Assert.IsTrue(value is IAspectPropertyValue);
            Assert.IsTrue(typeof(IAspectPropertyValue).IsAssignableFrom(value.GetType()));
            var dict = results.AsDictionary();

            Assert.IsTrue(dict.ContainsKey(_testPropertyName));
            var dictValue = dict[_testPropertyName];

            Assert.IsTrue(typeof(IAspectPropertyValue).IsAssignableFrom(dictValue.GetType()));
            Assert.AreEqual(expected, ((IAspectPropertyValue)dictValue).Value);
        }
Exemple #2
0
        public void GetDouble()
        {
            SetupElementProperties(typeof(double));
            double expected = 1;
            TestResults <double> results =
                new TestResults <double>(
                    _logger.Object,
                    _flowData.Object.Pipeline,
                    _engine.Object,
                    _missingPropertyService.Object,
                    expected);

            var value = results[_testPropertyName];

            Assert.IsTrue(value is IAspectPropertyValue);
            Assert.IsTrue(typeof(IAspectPropertyValue).IsAssignableFrom(value.GetType()));
            var dict = results.AsDictionary();

            Assert.IsTrue(dict.ContainsKey(_testPropertyName));
            var dictValue = dict[_testPropertyName];

            Assert.IsTrue(typeof(IAspectPropertyValue).IsAssignableFrom(dictValue.GetType()));
            Assert.AreEqual(expected, ((IAspectPropertyValue)dictValue).Value);
        }