Remove Test.Common dependency from LanguageServices.Razor.Test

This commit is contained in:
Ajay Bhargav Baaskaran 2017-06-30 10:42:15 -07:00
parent 7c7bb627b9
commit 34e3c249e4
4 changed files with 24 additions and 25 deletions

View File

@ -23,14 +23,14 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
.BindAttribute(attribute => attribute
.Name("visible")
.TypeName(typeof(bool).FullName)
.PropertyName("Visible"))
.SetPropertyName("Visible"))
.Build(),
TagHelperDescriptorBuilder.Create("StyleTagHelper", "TestAssembly")
.TagMatchingRule(rule => rule.RequireTagName("*"))
.BindAttribute(attribute => attribute
.Name("class")
.TypeName(typeof(string).FullName)
.PropertyName("Class"))
.SetPropertyName("Class"))
.Build(),
};
var expectedCompletions = AttributeCompletionResult.Create(new Dictionary<string, HashSet<BoundAttributeDescriptor>>()
@ -112,11 +112,11 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
.BindAttribute(attribute => attribute
.Name("repeat")
.TypeName(typeof(bool).FullName)
.PropertyName("Repeat"))
.SetPropertyName("Repeat"))
.BindAttribute(attribute => attribute
.Name("visible")
.TypeName(typeof(bool).FullName)
.PropertyName("Visible"))
.SetPropertyName("Visible"))
.Build(),
TagHelperDescriptorBuilder.Create("StyleTagHelper", "TestAssembly")
.TagMatchingRule(rule => rule
@ -125,7 +125,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
.BindAttribute(attribute => attribute
.Name("class")
.TypeName(typeof(string).FullName)
.PropertyName("Class"))
.SetPropertyName("Class"))
.Build(),
};
var expectedCompletions = AttributeCompletionResult.Create(new Dictionary<string, HashSet<BoundAttributeDescriptor>>()
@ -163,11 +163,11 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
.BindAttribute(attribute => attribute
.Name("repeat")
.TypeName(typeof(bool).FullName)
.PropertyName("Repeat"))
.SetPropertyName("Repeat"))
.BindAttribute(attribute => attribute
.Name("visible")
.TypeName(typeof(bool).FullName)
.PropertyName("Visible"))
.SetPropertyName("Visible"))
.Build(),
TagHelperDescriptorBuilder.Create("StyleTagHelper", "TestAssembly")
.TagMatchingRule(rule => rule
@ -176,14 +176,14 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
.BindAttribute(attribute => attribute
.Name("class")
.TypeName(typeof(string).FullName)
.PropertyName("Class"))
.SetPropertyName("Class"))
.Build(),
TagHelperDescriptorBuilder.Create("StyleTagHelper", "TestAssembly")
.TagMatchingRule(rule => rule.RequireTagName("*"))
.BindAttribute(attribute => attribute
.Name("visible")
.TypeName(typeof(bool).FullName)
.PropertyName("Visible"))
.SetPropertyName("Visible"))
.Build(),
};
var expectedCompletions = AttributeCompletionResult.Create(new Dictionary<string, HashSet<BoundAttributeDescriptor>>()
@ -226,7 +226,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
.BindAttribute(attribute => attribute
.Name("repeat")
.TypeName(typeof(bool).FullName)
.PropertyName("Repeat"))
.SetPropertyName("Repeat"))
.TagOutputHint("div")
.Build(),
};
@ -261,7 +261,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
.BindAttribute(attribute => attribute
.Name("repeat")
.TypeName(typeof(bool).FullName)
.PropertyName("Repeat"))
.SetPropertyName("Repeat"))
.Build(),
};
var expectedCompletions = AttributeCompletionResult.Create(new Dictionary<string, HashSet<BoundAttributeDescriptor>>()
@ -294,7 +294,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
.BindAttribute(attribute => attribute
.Name("repeat")
.TypeName(typeof(bool).FullName)
.PropertyName("Repeat"))
.SetPropertyName("Repeat"))
.Build(),
};
var expectedCompletions = AttributeCompletionResult.Create(new Dictionary<string, HashSet<BoundAttributeDescriptor>>()

View File

@ -48,12 +48,12 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
attribute
.Name("asp-for")
.TypeName(typeof(string).FullName)
.PropertyName("AspFor"))
.SetPropertyName("AspFor"))
.BindAttribute(attribute =>
attribute
.Name("asp-route")
.TypeName(typeof(IDictionary<string, string>).Namespace + "IDictionary<string, string>")
.PropertyName("AspRoute")
.SetPropertyName("AspRoute")
.AsDictionary("asp-route-", typeof(string).FullName))
.Build(),
TagHelperDescriptorBuilder.Create("TestType", "TestAssembly")
@ -62,7 +62,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
attribute
.Name("asp-for")
.TypeName(typeof(string).FullName)
.PropertyName("AspFor"))
.SetPropertyName("AspFor"))
.Build(),
};
var documentContext = TagHelperDocumentContext.Create(string.Empty, documentDescriptors);
@ -94,12 +94,12 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
attribute
.Name("asp-for")
.TypeName(typeof(string).FullName)
.PropertyName("AspFor"))
.SetPropertyName("AspFor"))
.BindAttribute(attribute =>
attribute
.Name("asp-route")
.TypeName(typeof(IDictionary<string, string>).Namespace + "IDictionary<string, string>")
.PropertyName("AspRoute")
.SetPropertyName("AspRoute")
.AsDictionary("asp-route-", typeof(string).FullName))
.Build()
};
@ -130,12 +130,12 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
attribute
.Name("asp-for")
.TypeName(typeof(string).FullName)
.PropertyName("AspFor"))
.SetPropertyName("AspFor"))
.BindAttribute(attribute =>
attribute
.Name("asp-extra")
.TypeName(typeof(string).FullName)
.PropertyName("AspExtra"))
.SetPropertyName("AspExtra"))
.Build()
};
var expectedAttributeDescriptors = new[]

View File

@ -24,7 +24,6 @@
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Language\Microsoft.AspNetCore.Razor.Language.csproj" />
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj" />
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor\Microsoft.AspNetCore.Razor.csproj" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
</ItemGroup>
<ItemGroup>

View File

@ -24,7 +24,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
{
builder => builder
.Name("test-attribute")
.PropertyName("TestAttribute")
.SetPropertyName("TestAttribute")
.TypeName("string"),
},
ruleBuilders: new Action<TagMatchingRuleDescriptorBuilder>[]
@ -67,7 +67,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
{
builder => builder
.Name("test-attribute")
.PropertyName("TestAttribute")
.SetPropertyName("TestAttribute")
.TypeName("string"),
},
ruleBuilders: new Action<TagMatchingRuleDescriptorBuilder>[]
@ -112,13 +112,13 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
{
builder => builder
.Name("test-attribute")
.PropertyName("TestAttribute")
.SetPropertyName("TestAttribute")
.TypeName("SomeEnum")
.AsEnum()
.Documentation("Summary"),
builder => builder
.Name("test-attribute2")
.PropertyName("TestAttribute2")
.SetPropertyName("TestAttribute2")
.TypeName("SomeDictionary")
.AsDictionary("dict-prefix-", "string"),
},
@ -154,7 +154,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
Action<TagHelperDescriptorBuilder> configureAction = null)
{
var builder = TagHelperDescriptorBuilder.Create(typeName, assemblyName);
builder.TypeName(typeName);
builder.SetTypeName(typeName);
if (attributes != null)
{