Skip to content

Instantly share code, notes, and snippets.

@Novakov
Created August 24, 2015 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Novakov/629fdac7dba168a5fc20 to your computer and use it in GitHub Desktop.
Save Novakov/629fdac7dba168a5fc20 to your computer and use it in GitHub Desktop.
[Theory]
[InlineData(typeof(string))]
[InlineData(typeof(byte))]
[InlineData(typeof(sbyte))]
[InlineData(typeof(short))]
[InlineData(typeof(ushort))]
[InlineData(typeof(int))]
[InlineData(typeof(uint))]
[InlineData(typeof(long))]
[InlineData(typeof(ulong))]
[InlineData(typeof(float))]
[InlineData(typeof(double))]
[InlineData(typeof(decimal))]
[InlineData(typeof(char))]
[InlineData(typeof(bool))]
[InlineData(typeof(object))]
[InlineData(typeof(Tuple<string>))]
[InlineData(typeof(Tuple<Tuple<string>>))]
[InlineData(typeof(Tuple<string, int>))]
[InlineData(typeof(Tuple<string, Tuple<int>>))]
[InlineData(typeof(Tuple<string, Tuple<int>, int>))]
[InlineData(typeof(Tuple<string, Tuple<int, string>, Tuple<int>, int>))]
[InlineData(typeof(Tuple<string, Tuple<int, string>, Tuple<int>, int, Tuple<string, Tuple<int, int>>>))]
[InlineData(typeof(int[]))]
[InlineData(typeof(int[,]))]
[InlineData(typeof(int[, , , ,]))]
[InlineData(typeof(int[][]))]
[InlineData(typeof(int[][, ,][]))]
[InlineData(typeof(Tuple<int, string>[][, ,][]))]
[InlineData(typeof(Tuple<int, int[][, ,][], string>))]
public void Should_be_able_to_render_csharp_view_with_generic_model(Type expectedType)
{
// Given
var location = this.TestGenericView(expectedType, new CSharpCodeProvider(), "model");
// When
var response = this.engine.RenderView(location, null, this.renderContext);
response.Contents.Invoke(stream);
// Then
stream.ShouldEqual(expectedType.FullName, true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment