예제 #1
0
        public async Task InferredMetadata()
        {
            var provider = await MSBuildEditorTesting.CreateProvider(@"
<Project><ItemGroup><Foo><Bar>a</Bar></Foo><Foo><$", ".csproj");

            Assert.IsNotNull(provider);
            AssertContainsItem(provider, "Bar");
            Assert.AreEqual(6, provider.Count);
        }
예제 #2
0
        public async Task ProjectCompletion()
        {
            var provider = await MSBuildEditorTesting.CreateProvider(@"<Project><$", ".csproj");

            Assert.IsNotNull(provider);
            AssertContainsItem(provider, "PropertyGroup");
            AssertContainsItem(provider, "Choose");
            Assert.AreEqual(12, provider.Count);
        }
예제 #3
0
        public async Task InferredMetadataAttribute()
        {
            var provider = await MSBuildEditorTesting.CreateProvider(@"
<Project><ItemGroup><Foo Bar=""a"" /><Foo $", ".csproj", true);

            Assert.IsNotNull(provider);
            AssertContainsItem(provider, "Bar");
            AssertContainsItem(provider, "Include");
            Assert.AreEqual(7, provider.Count);
        }
예제 #4
0
        public async Task PropertyFunctionChaining()
        {
            var provider = await MSBuildEditorTesting.CreateProvider(@"
<Project>
<PropertyGroup>
<Foo>$([System.DateTime]::Now.^", ".csproj", true, '^');

            Assert.IsNotNull(provider);
            AssertContainsItem(provider, "AddDays");
        }
예제 #5
0
        public async Task ProjectConfigurationPlatformInference()
        {
            var provider = await MSBuildEditorTesting.CreateProvider(@"
<Project><ItemGroup>
<ProjectConfiguration Configuration='Foo' Platform='Bar' Include='Foo|Bar' />
<Baz Condition=""$(Platform)=='^", ".csproj", true, '^');

            Assert.IsNotNull(provider);
            AssertContainsItem(provider, "Bar");
            Assert.AreEqual(3, provider.Count);
        }
예제 #6
0
        public async Task IndexerChaining()
        {
            var provider = await MSBuildEditorTesting.CreateProvider(@"
<Project>
<PropertyGroup>
<Foo>$(Foo[0].^", ".csproj", true, '^');

            Assert.IsNotNull(provider);
            AssertContainsItem(provider, "CompareTo");
            AssertDoesNotContainItem(provider, "Substring");
        }
예제 #7
0
        public async Task PropertyFunctionClassNames()
        {
            var provider = await MSBuildEditorTesting.CreateProvider(@"
<Project>
<PropertyGroup>
<Foo>$([^", ".csproj", true, '^');

            Assert.IsNotNull(provider);
            AssertContainsItem(provider, "MSBuild");
            AssertContainsItem(provider, "System.String");
        }
예제 #8
0
        public async Task InferredItems()
        {
            var provider = await MSBuildEditorTesting.CreateProvider(@"
<Project><ItemGroup><Foo /><Bar /><$", ".csproj");

            Assert.IsNotNull(provider);
            AssertContainsItem(provider, "Foo");
            AssertContainsItem(provider, "Bar");
            // comment, cdata, closing tags for Project and ItemGroup, plus the actual two items
            Assert.AreEqual(6, provider.Count);
        }
예제 #9
0
        public async Task IntrinsicStaticPropertyFunctionCompletion()
        {
            var provider = await MSBuildEditorTesting.CreateProvider(@"
<Project>
<PropertyGroup>
<Foo>$([MSBuild]::^", ".csproj", true, '^');

            Assert.IsNotNull(provider);
            AssertContainsItem(provider, "GetDirectoryNameOfFileAbove");
            Assert.AreEqual(32, provider.Count);
        }
예제 #10
0
        public async Task StaticPropertyFunctionCompletion()
        {
            var provider = await MSBuildEditorTesting.CreateProvider(@"
<Project>
<PropertyGroup>
<Foo>$([System.String]::^", ".csproj", true, '^');

            Assert.IsNotNull(provider);
            AssertContainsItem(provider, "new");
            AssertContainsItem(provider, "Join");
            AssertDoesNotContainItem(provider, "ToLower");
        }
예제 #11
0
        public async Task PlatformConfigurationInference()
        {
            var provider = await MSBuildEditorTesting.CreateProvider(@"
<Project>
<PropertyGroup Condition=""$(Platform)=='Foo'"" />
<ItemGroup>
<Baz Condition=""$(Platform)=='^", ".csproj", true, '^');

            Assert.IsNotNull(provider);
            AssertContainsItem(provider, "Foo");
            Assert.AreEqual(3, provider.Count);
        }
예제 #12
0
        public async Task ConfigurationsInference()
        {
            var provider = await MSBuildEditorTesting.CreateProvider(@"
<Project>
<PropertyGroup><Configurations>Foo;Bar</Configurations></PropertyGroup>
<ItemGroup>
<Baz Condition=""$(Configuration)=='^", ".csproj", true, '^');

            Assert.IsNotNull(provider);
            AssertContainsItem(provider, "Foo");
            AssertContainsItem(provider, "Bar");
            Assert.AreEqual(4, provider.Count);
        }
예제 #13
0
        public async Task PropertyStringFunctionCompletion()
        {
            var provider = await MSBuildEditorTesting.CreateProvider(@"
<Project>
<PropertyGroup>
<Foo>$(Foo.^", ".csproj", true, '^');

            Assert.IsNotNull(provider);
            //string functions
            AssertContainsItem(provider, "ToLower");
            //properties can be accessed with the getter method
            AssertContainsItem(provider, "get_Length");
            //.net properties are allowed for properties
            AssertContainsItem(provider, "Length");
            //indexers should be filtered out
            AssertDoesNotContainItem(provider, "this[]");
        }