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

Public Member Functions

void CreateControllerWithoutConfig ()
 
void LoadTest ()
 
void SaveToTest ()
 

Detailed Description

Definition at line 11 of file DbConfigTest.cs.

Member Function Documentation

void Deveel.Data.Control.DbConfigTest.CreateControllerWithoutConfig ( )
inline

Definition at line 13 of file DbConfigTest.cs.

13  {
14  Assert.DoesNotThrow(() => DbController.Create());
15  }
void Deveel.Data.Control.DbConfigTest.LoadTest ( )
inline

Definition at line 18 of file DbConfigTest.cs.

18  {
19  StringBuilder sb = new StringBuilder();
20  StringWriter writer = new StringWriter(sb);
21 
22  writer.WriteLine("key1=value1");
23  writer.WriteLine("key2 = on");
24  writer.WriteLine("key3= true");
25  writer.Flush();
26 
27  MemoryStream stream = new MemoryStream(Encoding.GetEncoding("ISO-8859-1").GetBytes(sb.ToString()));
28 
29  DbConfig config = DbConfig.Empty;
30  config.Load(stream);
31 
32  string value = config.GetValue<string>("key1");
33  Assert.IsNotNull(value, "The 'key1' was not set into the config.");
34  Assert.IsNotEmpty(value, "The value of 'key1' is empty.");
35  Assert.AreEqual("value1", value, "The value for 'key1' is not correct.");
36 
37  value = config.GetValue<string>("key2");
38  Assert.IsNotNull(value, "The 'key2' was not set into the config.");
39  Assert.IsNotEmpty(value, "The value of 'key2' is empty.");
40  Assert.AreEqual("on", value, "The value for 'key2' is not correct.");
41 
42  value = config.GetValue<string>("key3");
43  Assert.IsNotNull(value, "The 'key3' was not set into the config.");
44  Assert.IsNotEmpty(value, "The value of 'key3' is empty.");
45  Assert.AreEqual("true", value, "The value for 'key1' is not correct.");
46  }
void Deveel.Data.Control.DbConfigTest.SaveToTest ( )
inline

Definition at line 49 of file DbConfigTest.cs.

49  {
50  DbConfig config = DbConfig.Empty;
51  config.SetValue("key1", "value1");
52  config.SetValue("key2", "on");
53  config.SetValue("key3", "true");
54 
55  MemoryStream stream = new MemoryStream();
56  config.Save(stream);
57 
58  }

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