public void Get_Registered_Controllers() { var host = new CliControllerHost(); host.RegisterController <ExampleControllerA>(); host.RegisterController <ExampleControllerB>(); Type[] expectedControllers = new[] { typeof(ExampleControllerA), typeof(ExampleControllerB) }; Type[] controllers = host.Controllers.OrderBy(x => x.Name) .ToArray(); Assert.Equal(expectedControllers, controllers); }
public void Controller_Not_Static() { var host = new CliControllerHost(); Assert.Throws <ArgumentException>(() => { host.RegisterController(typeof(StaticController)); }); }
public void Controller_Not_Abstract() { var host = new CliControllerHost(); Assert.Throws <ArgumentException>(() => { host.RegisterController <AbstractController>(); }); }