public void TestCacheViaCode() { IServiceA serviceA = _container[typeof(IServiceA)] as IServiceA; serviceA.MyMethod(2, 5.5M); string consoleContents = _outWriter.GetStringBuilder().ToString(); serviceA.MyMethodNotcached("Gilles"); serviceA.MyMethod(2, 5.5M); Assert.AreEqual(consoleContents, _outWriter.GetStringBuilder().ToString()); }
public void TestContainer() { object controller = _container["HomeController"]; Assert.IsTrue(controller.GetType() == typeof(HomeController)); controller = _container["AccountController"]; Assert.IsTrue(controller.GetType() == typeof(AccountController)); IServiceA serviceA = _container[typeof(IServiceA)] as IServiceA; serviceA.MyMethodNotcached("Gilles"); }