Esempio n. 1
0
        public void CreateResourceFieldTest()
        {
            var decorator = new StandardResourcePropertyServiceDecorator();
            var resource  = CreateResourceDiscoveryV_1_0(ResourceName, ResourceAsJson);

            CodeMemberField codeField = decorator.CreateResourceField(resource, Enumerable.Empty <string>());

            Assert.IsNotNull(codeField);
            Assert.AreEqual(ResourceName + "Resource", codeField.Type.BaseType);
            Assert.AreEqual("_Test", codeField.Name);
        }
Esempio n. 2
0
        public void CreateResourceGetterTest()
        {
            var decorator = new StandardResourcePropertyServiceDecorator();
            var resource  = CreateResourceDiscoveryV_1_0(ResourceName, ResourceAsJson);

            CodeMemberProperty codeProperty = decorator.CreateResourceGetter(resource, Enumerable.Empty <string>());

            Assert.IsNotNull(codeProperty);
            Assert.IsFalse(codeProperty.HasSet);
            Assert.IsTrue(codeProperty.HasGet);
            Assert.AreEqual(ResourceName, codeProperty.Name);
            Assert.AreEqual(ResourceName + "Resource", codeProperty.Type.BaseType);
        }