private void SetCode()
        {
            var rawSelection       = span.GetText(span.TextBuffer.CurrentSnapshot);
            var property           = PropertySignature.FromRawSelection(rawSelection);
            var dependencyProperty = DependencyPropertySignature.FromRawSelection(rawSelection);

            nonIndentedCode = TextGenerator.GetNonIndentedCodeWithRegion(property, dependencyProperty);
            indentedCode    = TextGenerator.GetIndentedCodeWithRegion(property, dependencyProperty);
        }
Esempio n. 2
0
        public void ObjectReturnTypeProducesCorrectOutput()
        {
            var rawSelection = "public object TestNameProperty";
            var property     = PropertySignature.FromRawSelection(rawSelection);

            var expected = GenerateExpectedResultForObjectReturnType("public", "object", "TestName", "TestNameProperty");
            var result   = property.ToString();

            Assert.Equal(expected, result);
        }
Esempio n. 3
0
        public void GivenNameTypeAndAccessModifierProducesCorrectOutput()
        {
            var rawSelection = "internal string TestNameProperty";
            var property     = PropertySignature.FromRawSelection(rawSelection);

            var expected = GenerateExpectedResult("internal", "string", "TestName", "TestNameProperty");
            var result   = property.ToString();

            Assert.Equal(expected, result);
        }
Esempio n. 4
0
        public void GivenNameAndTypeProducesCorrectOutput()
        {
            var rawSelection = "string TestNameProperty";
            var property     = PropertySignature.FromRawSelection(rawSelection);

            var expected = GenerateExpectedResult(PropertySignature.DEFAULTACCESSMODIFIER, "string", "TestName", "TestNameProperty");
            var result   = property.ToString();

            Assert.Equal(expected, result);
        }