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

View File

@ -48,12 +48,12 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
attribute attribute
.Name("asp-for") .Name("asp-for")
.TypeName(typeof(string).FullName) .TypeName(typeof(string).FullName)
.PropertyName("AspFor")) .SetPropertyName("AspFor"))
.BindAttribute(attribute => .BindAttribute(attribute =>
attribute attribute
.Name("asp-route") .Name("asp-route")
.TypeName(typeof(IDictionary<string, string>).Namespace + "IDictionary<string, string>") .TypeName(typeof(IDictionary<string, string>).Namespace + "IDictionary<string, string>")
.PropertyName("AspRoute") .SetPropertyName("AspRoute")
.AsDictionary("asp-route-", typeof(string).FullName)) .AsDictionary("asp-route-", typeof(string).FullName))
.Build(), .Build(),
TagHelperDescriptorBuilder.Create("TestType", "TestAssembly") TagHelperDescriptorBuilder.Create("TestType", "TestAssembly")
@ -62,7 +62,7 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
attribute attribute
.Name("asp-for") .Name("asp-for")
.TypeName(typeof(string).FullName) .TypeName(typeof(string).FullName)
.PropertyName("AspFor")) .SetPropertyName("AspFor"))
.Build(), .Build(),
}; };
var documentContext = TagHelperDocumentContext.Create(string.Empty, documentDescriptors); var documentContext = TagHelperDocumentContext.Create(string.Empty, documentDescriptors);
@ -94,12 +94,12 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
attribute attribute
.Name("asp-for") .Name("asp-for")
.TypeName(typeof(string).FullName) .TypeName(typeof(string).FullName)
.PropertyName("AspFor")) .SetPropertyName("AspFor"))
.BindAttribute(attribute => .BindAttribute(attribute =>
attribute attribute
.Name("asp-route") .Name("asp-route")
.TypeName(typeof(IDictionary<string, string>).Namespace + "IDictionary<string, string>") .TypeName(typeof(IDictionary<string, string>).Namespace + "IDictionary<string, string>")
.PropertyName("AspRoute") .SetPropertyName("AspRoute")
.AsDictionary("asp-route-", typeof(string).FullName)) .AsDictionary("asp-route-", typeof(string).FullName))
.Build() .Build()
}; };
@ -130,12 +130,12 @@ namespace Microsoft.VisualStudio.LanguageServices.Razor
attribute attribute
.Name("asp-for") .Name("asp-for")
.TypeName(typeof(string).FullName) .TypeName(typeof(string).FullName)
.PropertyName("AspFor")) .SetPropertyName("AspFor"))
.BindAttribute(attribute => .BindAttribute(attribute =>
attribute attribute
.Name("asp-extra") .Name("asp-extra")
.TypeName(typeof(string).FullName) .TypeName(typeof(string).FullName)
.PropertyName("AspExtra")) .SetPropertyName("AspExtra"))
.Build() .Build()
}; };
var expectedAttributeDescriptors = new[] 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.Language\Microsoft.AspNetCore.Razor.Language.csproj" />
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.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="..\..\src\Microsoft.AspNetCore.Razor\Microsoft.AspNetCore.Razor.csproj" />
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

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