Definition at line 22 of file ServiceContainerTests.cs.
void Deveel.Data.Services.ServiceContainerTests.RegisterAndResolveFromChild |
( |
| ) |
|
|
inline |
Definition at line 24 of file ServiceContainerTests.cs.
25 var parent =
new ServiceContainer();
26 parent.Register<TestService1>();
28 var child = parent.OpenScope(
"child");
30 var childService = child.Resolve<ITestService>();
31 var parentService = parent.Resolve<ITestService>();
33 Assert.IsNotNull(childService);
34 Assert.IsInstanceOf<TestService1>(childService);
36 Assert.IsNotNull(parentService);
37 Assert.IsInstanceOf<TestService1>(parentService);
39 Assert.AreEqual(parentService, childService);
void Deveel.Data.Services.ServiceContainerTests.RegisterInstanceAndResolveAllFromChild |
( |
| ) |
|
|
inline |
Definition at line 59 of file ServiceContainerTests.cs.
60 var instance =
new TestService1();
62 var parent =
new ServiceContainer();
63 parent.RegisterInstance(instance);
65 var child = parent.OpenScope(
"child");
67 var services = child.ResolveAll<ITestService>();
69 Assert.IsNotEmpty(services);
70 Assert.AreEqual(1, services.Count());
void Deveel.Data.Services.ServiceContainerTests.RegisterInstanceAndResolveFromChild |
( |
| ) |
|
|
inline |
Definition at line 43 of file ServiceContainerTests.cs.
44 var instance =
new TestService1();
46 var parent =
new ServiceContainer();
47 parent.RegisterInstance(instance);
49 var child = parent.OpenScope(
"child");
51 var childService = child.Resolve<ITestService>();
53 Assert.IsNotNull(childService);
54 Assert.IsInstanceOf<TestService1>(childService);
55 Assert.AreEqual(instance, childService);
void Deveel.Data.Services.ServiceContainerTests.ResolveFromChildWithParentService |
( |
| ) |
|
|
inline |
Definition at line 74 of file ServiceContainerTests.cs.
75 var parent =
new ServiceContainer();
76 parent.Register<TestService1>();
78 var child = parent.OpenScope(
"child");
79 child.Register<TestService2>();
81 var service2 = child.Resolve<TestService2>();
83 Assert.IsNotNull(service2);
84 Assert.IsNotNull(service2.Service1);
The documentation for this class was generated from the following file: