React to aspnet/Razor#238.
- Updated tests to create TagHelperContext correctly.
This commit is contained in:
parent
df4b92b1c1
commit
1cc9be5df7
|
|
@ -32,6 +32,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{ "asp-host", "contoso.com" },
|
{ "asp-host", "contoso.com" },
|
||||||
{ "asp-protocol", "http" }
|
{ "asp-protocol", "http" }
|
||||||
},
|
},
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something Else"));
|
getChildContentAsync: () => Task.FromResult("Something Else"));
|
||||||
var output = new TagHelperOutput(
|
var output = new TagHelperOutput(
|
||||||
|
|
@ -82,6 +83,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
// Arrange
|
// Arrange
|
||||||
var context = new TagHelperContext(
|
var context = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(
|
var output = new TagHelperOutput(
|
||||||
|
|
@ -120,14 +122,15 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
// Arrange
|
// Arrange
|
||||||
var context = new TagHelperContext(
|
var context = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(
|
var output = new TagHelperOutput(
|
||||||
"a",
|
"a",
|
||||||
attributes: new Dictionary<string, string>())
|
attributes: new Dictionary<string, string>())
|
||||||
{
|
{
|
||||||
Content = string.Empty
|
Content = string.Empty
|
||||||
};
|
};
|
||||||
|
|
||||||
var generator = new Mock<IHtmlGenerator>();
|
var generator = new Mock<IHtmlGenerator>();
|
||||||
generator
|
generator
|
||||||
|
|
|
||||||
|
|
@ -702,18 +702,20 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var expectedContent = "some-content";
|
var expectedContent = "some-content";
|
||||||
var tokenSource = new CancellationTokenSource();
|
var tokenSource = new CancellationTokenSource();
|
||||||
var cache = new MemoryCache(new MemoryCacheOptions());
|
var cache = new MemoryCache(new MemoryCacheOptions());
|
||||||
var tagHelperContext = new TagHelperContext(new Dictionary<string, object>(),
|
var tagHelperContext = new TagHelperContext(
|
||||||
id,
|
allAttributes: new Dictionary<string, object>(),
|
||||||
() =>
|
items: new Dictionary<object, object>(),
|
||||||
{
|
uniqueId: id,
|
||||||
var entryLink = EntryLinkHelpers.ContextLink;
|
getChildContentAsync: () =>
|
||||||
Assert.NotNull(entryLink);
|
{
|
||||||
entryLink.AddExpirationTriggers(new[]
|
var entryLink = EntryLinkHelpers.ContextLink;
|
||||||
{
|
Assert.NotNull(entryLink);
|
||||||
new CancellationTokenTrigger(tokenSource.Token)
|
entryLink.AddExpirationTriggers(new[]
|
||||||
});
|
{
|
||||||
return Task.FromResult(expectedContent);
|
new CancellationTokenTrigger(tokenSource.Token)
|
||||||
});
|
});
|
||||||
|
return Task.FromResult(expectedContent);
|
||||||
|
});
|
||||||
var tagHelperOutput = new TagHelperOutput("cache", new Dictionary<string, string>())
|
var tagHelperOutput = new TagHelperOutput("cache", new Dictionary<string, string>())
|
||||||
{
|
{
|
||||||
PreContent = "<cache>",
|
PreContent = "<cache>",
|
||||||
|
|
@ -757,9 +759,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
private static TagHelperContext GetTagHelperContext(string id = "testid",
|
private static TagHelperContext GetTagHelperContext(string id = "testid",
|
||||||
string childContent = "some child content")
|
string childContent = "some child content")
|
||||||
{
|
{
|
||||||
return new TagHelperContext(new Dictionary<string, object>(),
|
return new TagHelperContext(
|
||||||
id,
|
allAttributes: new Dictionary<string, object>(),
|
||||||
() => Task.FromResult(childContent));
|
items: new Dictionary<object, object>(),
|
||||||
|
uniqueId: id,
|
||||||
|
getChildContentAsync: () => Task.FromResult(childContent));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetHashedBytes(string input)
|
private static string GetHashedBytes(string input)
|
||||||
|
|
|
||||||
|
|
@ -134,13 +134,17 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Test
|
||||||
{
|
{
|
||||||
attributes = attributes ?? new Dictionary<string, object>();
|
attributes = attributes ?? new Dictionary<string, object>();
|
||||||
|
|
||||||
return new TagHelperContext(attributes, Guid.NewGuid().ToString("N"), () => Task.FromResult(content));
|
return new TagHelperContext(
|
||||||
|
attributes,
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
|
uniqueId: Guid.NewGuid().ToString("N"),
|
||||||
|
getChildContentAsync: () => Task.FromResult(content));
|
||||||
}
|
}
|
||||||
|
|
||||||
private TagHelperOutput MakeTagHelperOutput(string tagName, IDictionary<string, string> attributes = null)
|
private TagHelperOutput MakeTagHelperOutput(string tagName, IDictionary<string, string> attributes = null)
|
||||||
{
|
{
|
||||||
attributes = attributes ?? new Dictionary<string, string>();
|
attributes = attributes ?? new Dictionary<string, string>();
|
||||||
|
|
||||||
return new TagHelperOutput(tagName, attributes);
|
return new TagHelperOutput(tagName, attributes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{ "method", "post" },
|
{ "method", "post" },
|
||||||
{ "asp-anti-forgery", true }
|
{ "asp-anti-forgery", true }
|
||||||
},
|
},
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something Else"));
|
getChildContentAsync: () => Task.FromResult("Something Else"));
|
||||||
var output = new TagHelperOutput(
|
var output = new TagHelperOutput(
|
||||||
|
|
@ -92,6 +93,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var viewContext = CreateViewContext();
|
var viewContext = CreateViewContext();
|
||||||
var context = new TagHelperContext(
|
var context = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(
|
var output = new TagHelperOutput(
|
||||||
|
|
@ -137,6 +139,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var testViewContext = CreateViewContext();
|
var testViewContext = CreateViewContext();
|
||||||
var context = new TagHelperContext(
|
var context = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var expectedAttribute = new KeyValuePair<string, string>("asp-ROUTEE-NotRoute", "something");
|
var expectedAttribute = new KeyValuePair<string, string>("asp-ROUTEE-NotRoute", "something");
|
||||||
|
|
@ -202,6 +205,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var viewContext = CreateViewContext();
|
var viewContext = CreateViewContext();
|
||||||
var context = new TagHelperContext(
|
var context = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(
|
var output = new TagHelperOutput(
|
||||||
|
|
@ -256,6 +260,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{
|
{
|
||||||
{ "METhod", "POST" }
|
{ "METhod", "POST" }
|
||||||
},
|
},
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
|
|
||||||
|
|
@ -302,6 +307,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
});
|
});
|
||||||
var context = new TagHelperContext(
|
var context = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,9 +94,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var expectedPostContent = "original post-content";
|
var expectedPostContent = "original post-content";
|
||||||
var expectedTagName = "not-input";
|
var expectedTagName = "not-input";
|
||||||
|
|
||||||
var context = new TagHelperContext(allAttributes: new Dictionary<string, object>(),
|
var context = new TagHelperContext(
|
||||||
uniqueId: "test",
|
allAttributes: new Dictionary<string, object>(),
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
items: new Dictionary<object, object>(),
|
||||||
|
uniqueId: "test",
|
||||||
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var originalAttributes = new Dictionary<string, string>
|
var originalAttributes = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "class", "form-control" },
|
{ "class", "form-control" },
|
||||||
|
|
@ -148,9 +150,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var expectedContent = originalContent + "<input class=\"form-control\" /><hidden />";
|
var expectedContent = originalContent + "<input class=\"form-control\" /><hidden />";
|
||||||
var expectedPostContent = "original post-content";
|
var expectedPostContent = "original post-content";
|
||||||
|
|
||||||
var context = new TagHelperContext(allAttributes: new Dictionary<string, object>(),
|
var context = new TagHelperContext(
|
||||||
uniqueId: "test",
|
allAttributes: new Dictionary<string, object>(),
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
items: new Dictionary<object, object>(),
|
||||||
|
uniqueId: "test",
|
||||||
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var originalAttributes = new Dictionary<string, string>
|
var originalAttributes = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "class", "form-control" },
|
{ "class", "form-control" },
|
||||||
|
|
@ -237,9 +241,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var expectedPostContent = "original post-content";
|
var expectedPostContent = "original post-content";
|
||||||
var expectedTagName = "not-input";
|
var expectedTagName = "not-input";
|
||||||
|
|
||||||
var context = new TagHelperContext(allAttributes: contextAttributes,
|
var context = new TagHelperContext(
|
||||||
uniqueId: "test",
|
allAttributes: contextAttributes,
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
items: new Dictionary<object, object>(),
|
||||||
|
uniqueId: "test",
|
||||||
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var originalAttributes = new Dictionary<string, string>
|
var originalAttributes = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "class", "form-control" },
|
{ "class", "form-control" },
|
||||||
|
|
@ -323,9 +329,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var expectedPostContent = "original post-content";
|
var expectedPostContent = "original post-content";
|
||||||
var expectedTagName = "not-input";
|
var expectedTagName = "not-input";
|
||||||
|
|
||||||
var context = new TagHelperContext(allAttributes: contextAttributes,
|
var context = new TagHelperContext(
|
||||||
uniqueId: "test",
|
allAttributes: contextAttributes,
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
items: new Dictionary<object, object>(),
|
||||||
|
uniqueId: "test",
|
||||||
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var originalAttributes = new Dictionary<string, string>
|
var originalAttributes = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "class", "form-control" },
|
{ "class", "form-control" },
|
||||||
|
|
@ -406,9 +414,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var expectedPostContent = "original post-content";
|
var expectedPostContent = "original post-content";
|
||||||
var expectedTagName = "not-input";
|
var expectedTagName = "not-input";
|
||||||
|
|
||||||
var context = new TagHelperContext(allAttributes: contextAttributes,
|
var context = new TagHelperContext(
|
||||||
uniqueId: "test",
|
allAttributes: contextAttributes,
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
items: new Dictionary<object, object>(),
|
||||||
|
uniqueId: "test",
|
||||||
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var originalAttributes = new Dictionary<string, string>
|
var originalAttributes = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "class", "form-control" },
|
{ "class", "form-control" },
|
||||||
|
|
@ -504,9 +514,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var expectedPostContent = "original post-content";
|
var expectedPostContent = "original post-content";
|
||||||
var expectedTagName = "not-input";
|
var expectedTagName = "not-input";
|
||||||
|
|
||||||
var context = new TagHelperContext(allAttributes: contextAttributes,
|
var context = new TagHelperContext(
|
||||||
uniqueId: "test",
|
allAttributes: contextAttributes,
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
items: new Dictionary<object, object>(),
|
||||||
|
uniqueId: "test",
|
||||||
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var originalAttributes = new Dictionary<string, string>
|
var originalAttributes = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ "class", "form-control" },
|
{ "class", "form-control" },
|
||||||
|
|
@ -573,6 +585,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
|
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(expectedTagName, expectedAttributes)
|
var output = new TagHelperOutput(expectedTagName, expectedAttributes)
|
||||||
|
|
@ -628,6 +641,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
|
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(expectedTagName, originalAttributes);
|
var output = new TagHelperOutput(expectedTagName, originalAttributes);
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Internal
|
||||||
public void DetermineMode_FindsFullModeMatchWithSingleAttribute()
|
public void DetermineMode_FindsFullModeMatchWithSingleAttribute()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var modeInfo = new []
|
var modeInfo = new[]
|
||||||
{
|
{
|
||||||
ModeAttributes.Create("mode0", new [] { "first-attr" })
|
ModeAttributes.Create("mode0", new [] { "first-attr" })
|
||||||
};
|
};
|
||||||
|
|
@ -124,7 +124,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Internal
|
||||||
{
|
{
|
||||||
attributes = attributes ?? new Dictionary<string, object>();
|
attributes = attributes ?? new Dictionary<string, object>();
|
||||||
|
|
||||||
return new TagHelperContext(attributes, Guid.NewGuid().ToString("N"), () => Task.FromResult(content));
|
return new TagHelperContext(
|
||||||
|
attributes,
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
|
uniqueId: Guid.NewGuid().ToString("N"),
|
||||||
|
getChildContentAsync: () => Task.FromResult(content));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -183,6 +183,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
|
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult(tagHelperOutputContent.OriginalChildContent));
|
getChildContentAsync: () => Task.FromResult(tagHelperOutputContent.OriginalChildContent));
|
||||||
var htmlAttributes = new Dictionary<string, string>
|
var htmlAttributes = new Dictionary<string, string>
|
||||||
|
|
@ -242,6 +243,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
|
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(expectedTagName, expectedAttributes)
|
var output = new TagHelperOutput(expectedTagName, expectedAttributes)
|
||||||
|
|
|
||||||
|
|
@ -337,7 +337,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{
|
{
|
||||||
attributes = attributes ?? new Dictionary<string, object>();
|
attributes = attributes ?? new Dictionary<string, object>();
|
||||||
|
|
||||||
return new TagHelperContext(attributes, Guid.NewGuid().ToString("N"), () => Task.FromResult(content));
|
return new TagHelperContext(
|
||||||
|
attributes,
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
|
uniqueId: Guid.NewGuid().ToString("N"),
|
||||||
|
getChildContentAsync: () => Task.FromResult(content));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TagHelperOutput MakeTagHelperOutput(string tagName, IDictionary<string, string> attributes = null)
|
private static TagHelperOutput MakeTagHelperOutput(string tagName, IDictionary<string, string> attributes = null)
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
};
|
};
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
contextAttributes,
|
contextAttributes,
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult(originalContent));
|
getChildContentAsync: () => Task.FromResult(originalContent));
|
||||||
var output = new TagHelperOutput(expectedTagName, originalAttributes)
|
var output = new TagHelperOutput(expectedTagName, originalAttributes)
|
||||||
|
|
@ -196,6 +197,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var originalPostContent = "original post-content";
|
var originalPostContent = "original post-content";
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
contextAttributes,
|
contextAttributes,
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult(originalContent));
|
getChildContentAsync: () => Task.FromResult(originalContent));
|
||||||
var output = new TagHelperOutput(originalTagName, originalAttributes)
|
var output = new TagHelperOutput(originalTagName, originalAttributes)
|
||||||
|
|
@ -251,6 +253,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var originalPostContent = "original post-content";
|
var originalPostContent = "original post-content";
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
contextAttributes,
|
contextAttributes,
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult(originalContent));
|
getChildContentAsync: () => Task.FromResult(originalContent));
|
||||||
var output = new TagHelperOutput(originalTagName, originalAttributes)
|
var output = new TagHelperOutput(originalTagName, originalAttributes)
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{
|
{
|
||||||
attributes = attributes ?? new Dictionary<string, object>();
|
attributes = attributes ?? new Dictionary<string, object>();
|
||||||
|
|
||||||
return new TagHelperContext(attributes, Guid.NewGuid().ToString("N"), () => Task.FromResult(content));
|
return new TagHelperContext(
|
||||||
|
attributes,
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
|
uniqueId: Guid.NewGuid().ToString("N"),
|
||||||
|
getChildContentAsync: () => Task.FromResult(content));
|
||||||
}
|
}
|
||||||
|
|
||||||
private TagHelperOutput MakeTagHelperOutput(string tagName, IDictionary<string, string> attributes = null)
|
private TagHelperOutput MakeTagHelperOutput(string tagName, IDictionary<string, string> attributes = null)
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
|
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(expectedTagName, originalAttributes)
|
var output = new TagHelperOutput(expectedTagName, originalAttributes)
|
||||||
|
|
@ -276,6 +277,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
|
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(expectedTagName, originalAttributes)
|
var output = new TagHelperOutput(expectedTagName, originalAttributes)
|
||||||
|
|
@ -358,6 +360,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
|
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
contextAttributes,
|
contextAttributes,
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(expectedTagName, originalAttributes);
|
var output = new TagHelperOutput(expectedTagName, originalAttributes);
|
||||||
|
|
@ -423,6 +426,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
|
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
contextAttributes,
|
contextAttributes,
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(tagName, originalAttributes);
|
var output = new TagHelperOutput(tagName, originalAttributes);
|
||||||
|
|
@ -478,6 +482,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
|
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
contextAttributes,
|
contextAttributes,
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(expectedTagName, originalAttributes);
|
var output = new TagHelperOutput(expectedTagName, originalAttributes);
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{
|
{
|
||||||
{ attributeName, attributeValue }
|
{ attributeName, attributeValue }
|
||||||
},
|
},
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var expectedAttribute = new KeyValuePair<string, string>(attributeName, attributeValue);
|
var expectedAttribute = new KeyValuePair<string, string>(attributeName, attributeValue);
|
||||||
|
|
@ -55,6 +56,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{
|
{
|
||||||
{ attributeName, "world" }
|
{ attributeName, "world" }
|
||||||
},
|
},
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
|
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var htmlAttributes = new Dictionary<string, string>
|
var htmlAttributes = new Dictionary<string, string>
|
||||||
|
|
@ -165,6 +166,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
|
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(expectedTagName, expectedAttributes)
|
var output = new TagHelperOutput(expectedTagName, expectedAttributes)
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
{ "id", "myvalidationmessage" },
|
{ "id", "myvalidationmessage" },
|
||||||
{ "for", modelExpression },
|
{ "for", modelExpression },
|
||||||
},
|
},
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(
|
var output = new TagHelperOutput(
|
||||||
|
|
@ -90,6 +91,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var expectedPostContent = "original post-content";
|
var expectedPostContent = "original post-content";
|
||||||
var context = new TagHelperContext(
|
var context = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(
|
var output = new TagHelperOutput(
|
||||||
|
|
@ -140,9 +142,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
Content = outputContent
|
Content = outputContent
|
||||||
};
|
};
|
||||||
|
|
||||||
var context = new TagHelperContext(allAttributes: new Dictionary<string, object>(),
|
var context = new TagHelperContext(
|
||||||
uniqueId: "test",
|
allAttributes: new Dictionary<string, object>(),
|
||||||
getChildContentAsync: () => Task.FromResult(childContent));
|
items: new Dictionary<object, object>(),
|
||||||
|
uniqueId: "test",
|
||||||
|
getChildContentAsync: () => Task.FromResult(childContent));
|
||||||
var tagBuilder = new TagBuilder("span2")
|
var tagBuilder = new TagBuilder("span2")
|
||||||
{
|
{
|
||||||
InnerHtml = "New HTML"
|
InnerHtml = "New HTML"
|
||||||
|
|
@ -191,9 +195,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
"span",
|
"span",
|
||||||
attributes: new Dictionary<string, string>());
|
attributes: new Dictionary<string, string>());
|
||||||
|
|
||||||
var context = new TagHelperContext(allAttributes: new Dictionary<string, object>(),
|
var context = new TagHelperContext(
|
||||||
uniqueId: "test",
|
allAttributes: new Dictionary<string, object>(),
|
||||||
getChildContentAsync: () => Task.FromResult(childContent));
|
items: new Dictionary<object, object>(),
|
||||||
|
uniqueId: "test",
|
||||||
|
getChildContentAsync: () => Task.FromResult(childContent));
|
||||||
var tagBuilder = new TagBuilder("span2")
|
var tagBuilder = new TagBuilder("span2")
|
||||||
{
|
{
|
||||||
InnerHtml = "New HTML"
|
InnerHtml = "New HTML"
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
|
||||||
var expectedContent = "original content";
|
var expectedContent = "original content";
|
||||||
var tagHelperContext = new TagHelperContext(
|
var tagHelperContext = new TagHelperContext(
|
||||||
allAttributes: new Dictionary<string, object>(),
|
allAttributes: new Dictionary<string, object>(),
|
||||||
|
items: new Dictionary<object, object>(),
|
||||||
uniqueId: "test",
|
uniqueId: "test",
|
||||||
getChildContentAsync: () => Task.FromResult("Something"));
|
getChildContentAsync: () => Task.FromResult("Something"));
|
||||||
var output = new TagHelperOutput(
|
var output = new TagHelperOutput(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue