public void NetServiceCollection_Initialized_ServiceInitialized() { NetServiceCollection c = new NetServiceCollection(); c.Register <TestNetService>(); c.LockServices(); c.InitializeServices(new NetContext()); Assert.IsTrue(c.Get <TestNetService>().Initialized == true); }
public void NetServiceCollection_GetServices_HasServices() { NetServiceCollection c = new NetServiceCollection(); c.Register <TestNetService>(); c.LockServices(); Assert.IsTrue(c.ServiceList.Count() == 1); Assert.IsTrue(c.ServiceList.First() == c.Get <TestNetService>()); }
public void NetServiceCollection_RegisterService_HasService() { NetServiceCollection c = new NetServiceCollection(); c.Register <TestNetService>(); c.LockServices(); var result = c.Get <TestNetService>(); Assert.IsNotNull(result); }
public void NetServiceCollection_Disposed_ServiceDisposed() { NetServiceCollection c = new NetServiceCollection(); c.Register <TestNetService>(); c.LockServices(); var svc = c.Get <TestNetService>(); c.Dispose(); Assert.IsTrue(svc.Disposed == true); }
public void NetServiceCollection_RegisterServiceWithConfigure_ServiceConfigured() { NetServiceCollection c = new NetServiceCollection(); c.Register <TestNetService>(); c.Configure <TestNetService>((o) => { o.Configured = true; }); c.LockServices(); var svc = c.Get <TestNetService>(); Assert.IsNotNull(svc); Assert.IsTrue(svc.Configured); }