DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Classes | Public Member Functions | List of all members
Deveel.Data.SystemTests Class Reference

Classes

interface  ITestService
 
class  TestService
 
class  TestService2
 
class  TestService3
 

Public Member Functions

void FromDefaultConfig ()
 
void ResolveSingleServiceFromRegister ()
 
void ResolveManyServicesForInterface ()
 
void ResolveInstanceOfServiceByInterface ()
 

Detailed Description

Definition at line 25 of file SystemTests.cs.

Member Function Documentation

void Deveel.Data.SystemTests.FromDefaultConfig ( )
inline

Definition at line 27 of file SystemTests.cs.

27  {
28  var builder = new SystemBuilder();
29  ISystem system = null;
30  Assert.DoesNotThrow(() => system = builder.BuildSystem());
31  Assert.IsNotNull(system);
32  Assert.IsFalse(system.Context.ReadOnly());
33  Assert.IsTrue(system.Context.IgnoreIdentifiersCase());
34  Assert.AreEqual("APP", system.Context.DefaultSchema());
35  }
void Deveel.Data.SystemTests.ResolveInstanceOfServiceByInterface ( )
inline

Definition at line 79 of file SystemTests.cs.

79  {
80  var builder = new SystemBuilder();
81  ISystem system = null;
82  Assert.DoesNotThrow(() => system = builder.BuildSystem());
83  Assert.IsNotNull(system);
84 
85  system.Context.RegisterInstance(new TestService());
86  system.Context.RegisterInstance(new TestService2());
87  system.Context.RegisterService<TestService3>();
88 
89  IEnumerable<ITestService> services = null;
90  Assert.DoesNotThrow(() => services = system.Context.ResolveAllServices<ITestService>());
91  Assert.IsNotNull(services);
92 
93  var serviceList = services.ToList();
94 
95  Assert.IsNotEmpty(serviceList);
96  Assert.AreEqual(2, serviceList.Count);
97  Assert.IsInstanceOf<TestService2>(serviceList[0]);
98  Assert.IsInstanceOf<TestService3>(serviceList[1]);
99  }
void Deveel.Data.SystemTests.ResolveManyServicesForInterface ( )
inline

Definition at line 56 of file SystemTests.cs.

56  {
57  var builder = new SystemBuilder();
58  ISystem system = null;
59  Assert.DoesNotThrow(() => system = builder.BuildSystem());
60  Assert.IsNotNull(system);
61 
62  system.Context.RegisterService<TestService>();
63  system.Context.RegisterService<TestService2>();
64  system.Context.RegisterService<TestService3>();
65 
66  IEnumerable<ITestService> services = null;
67  Assert.DoesNotThrow(() => services = system.Context.ResolveAllServices<ITestService>());
68  Assert.IsNotNull(services);
69 
70  var serviceList = services.ToList();
71 
72  Assert.IsNotEmpty(serviceList);
73  Assert.AreEqual(2, serviceList.Count);
74  Assert.IsInstanceOf<TestService2>(serviceList[0]);
75  Assert.IsInstanceOf<TestService3>(serviceList[1]);
76  }
void Deveel.Data.SystemTests.ResolveSingleServiceFromRegister ( )
inline

Definition at line 38 of file SystemTests.cs.

38  {
39  var builder = new SystemBuilder();
40  ISystem system = null;
41  Assert.DoesNotThrow(() => system = builder.BuildSystem());
42  Assert.IsNotNull(system);
43 
44  system.Context.RegisterService<TestService>();
45 
46  object serviceObj = null;
47  Assert.DoesNotThrow(() => serviceObj = system.Context.ResolveService(typeof(TestService)));
48  Assert.IsNotNull(serviceObj);
49  Assert.IsInstanceOf<TestService>(serviceObj);
50 
51  var service = (TestService)serviceObj;
52  Assert.DoesNotThrow(() => service.SayHello());
53  }

The documentation for this class was generated from the following file: