コード例 #1
0
        public void SelectScalarValueUsingPocoScalarPathFromXml_Expected_ScalarValue()
        {
            string testData = GivenXml();

            IPath        namePath    = new XmlPath("Company:Name", "Company:Name");
            IDataBrowser dataBrowser = DataBrowserFactory.CreateDataBrowser();

            object data = dataBrowser.SelectScalar(namePath, testData);

            Assert.AreEqual(data, "Dev2");
        }
コード例 #2
0
        public void SelectScalarValueUsingJsonScalarPathFromJson_Expected_ScalarValue()
        {
            string testData = GivenJson();

            IPath        namePath    = new JsonPath("Name", "Name");
            IDataBrowser dataBrowser = DataBrowserFactory.CreateDataBrowser();

            object data = dataBrowser.SelectScalar(namePath, testData);

            Assert.AreEqual(data, "Dev2");
        }
コード例 #3
0
        public void SelectScalarValueUsingPocoScalarPathFromReferenceType_Expected_ScalarValue()
        {
            PocoTestData testData = GivenPoco();

            IPath        namePath    = new PocoPath("Name", "Name");
            IDataBrowser dataBrowser = DataBrowserFactory.CreateDataBrowser();

            object data = dataBrowser.SelectScalar(namePath, testData);

            Assert.AreEqual(data, testData.Name);
        }