Ejemplo n.º 1
0
        public void GetValueForPropertyTest()
        {
            TestPage testPage = new TestPage();

            string dummyObject = "dummy";
            string propertyName = "Property1";
            string expectedValue = "Value1";

            testPage.SetObjects(1, new object[] { dummyObject });
            TestIPropertyStore testPropertyStore = testPage.IPropertyStore as TestIPropertyStore;
            testPropertyStore.Properties.Add(propertyName, expectedValue);

            string actualValue = testPage.GetValueForProperty(propertyName);
            Assert.AreEqual(expectedValue, actualValue);
        }
Ejemplo n.º 2
0
        public void GetPropertyStoreTest()
        {
            TestPage testPage = new TestPage();
            testPage.GetRealStore = true;

            string propertyName = "Property1";
            string propertyValue = "Value1";

            TestIVsBrowseObject dataObject = new TestIVsBrowseObject();
            TestIVsHierarchy hierarchy = new TestIVsHierarchy();
            dataObject.Hierarchy = hierarchy;
            TestDTEProject dteProject = new TestDTEProject();
            hierarchy.dteProject = dteProject;
            TestDTEProperties dteProjectProperties = new TestDTEProperties();
            dteProject.ProjectProperties = dteProjectProperties;
            TestDTEProperty property1 = new TestDTEProperty();
            property1.PropertyValue = propertyValue;
            dteProjectProperties.Properties.Add(propertyName, property1);

            testPage.SetObjects(1, new object[] { dataObject });
            Assert.AreEqual(propertyValue, testPage.GetValueForProperty(propertyName));
        }