コード例 #1
0
 private void AssertBaseEqual(string expected, Type t)
 {
     var actual = new ServiceGenerator(
         new ServiceGeneratorOptions { NamespaceSubstitution = new Tuple<string, string>("Southpaw.Generator.Tests.Controller", "Southpaw.Tests.Output.Services") },
         new ViewModelGeneratorOptions { NamespaceSubstitution = new Tuple<string, string>("Southpaw.Generator.Tests", "Southpaw.Tests.Output.Models") }
     ).GenerateBase(t);
     Console.Write(actual);
     Assert.AreEqual(expected, actual);
 }
コード例 #2
0
 private void AssertSuperEqual(List<string> expected, Type t)
 {
     var actual = new ServiceGenerator(
         new ServiceGeneratorOptions { NamespaceSubstitution = new Tuple<string, string>("Southpaw.Generator.Tests.Controller", "Southpaw.Tests.Output.Services") },
         new ViewModelGeneratorOptions { NamespaceSubstitution = new Tuple<string, string>("Southpaw.Generator.Tests", "Southpaw.Tests.Output.Models") }
     ).GenerateSuper(t);
     for (var i = 0; i < actual.Count; i++)
     {
         Console.Write(actual[actual.Keys.ElementAt(i)]);
         Assert.AreEqual(expected[i], actual[actual.Keys.ElementAt(i)]);
     }
 }
コード例 #3
0
 public void ValidateControllerType_WithValidController_ShouldNotThrow()
 {
     var actual = new ServiceGenerator(
         new ServiceGeneratorOptions { NamespaceSubstitution = new Tuple<string, string>("Southpaw.Generator.Tests.Controller", "Southpaw.Tests.Output.Services") },
         new ViewModelGeneratorOptions { NamespaceSubstitution = new Tuple<string, string>("Southpaw.Generator.Tests", "Southpaw.Tests.Output.Models") }
     ).ValidateControllerType(typeof(ControllerWithModelAndArgument));
 }