Esempio n. 1
0
 public void Any()
 {
     using (Mapping <ObjectClass1> TestObject = new Mapping <ObjectClass1>("Data Source=localhost;Initial Catalog=TestDatabase;Integrated Security=SSPI;Pooling=false", "TestTable", "ID_"))
     {
         TestObject.Map(x => x.ID, "ID_")
         .Map(x => x.StringValue, "StringValue_", 100)
         .Map(x => x.FloatValue, "FloatValue_")
         .Map(x => x.BoolValue, "BoolValue_")
         .Map(x => x.LongValue, "LongValue_")
         .Map(x => x.StringMaxValue, "StringMaxValue_", -1);
         Utilities.Random.Random Rand       = new Utilities.Random.Random(12345);
         ObjectClass1            TempObject = new ObjectClass1();
         TempObject.StringValue    = "Test String";
         TempObject.BoolValue      = true;
         TempObject.FloatValue     = 1234.5f;
         TempObject.LongValue      = 12345;
         TempObject.StringMaxValue = Rand.Next <string>(new RegexStringGenerator(6000));
         string StringMaxValue = TempObject.StringMaxValue;
         TestObject.Save <int>(TempObject);
         TempObject = TestObject.Any();
         Assert.Equal("Test String", TempObject.StringValue);
         Assert.Equal(1234.5f, TempObject.FloatValue);
         Assert.Equal(true, TempObject.BoolValue);
         Assert.Equal(12345, TempObject.LongValue);
         Assert.Equal(1, TempObject.ID);
         Assert.Equal(StringMaxValue, TempObject.StringMaxValue);
     }
 }
Esempio n. 2
0
 public void Any()
 {
     using (Mapping <ObjectClass1> TestObject = new Mapping <ObjectClass1>("Data Source=localhost;Initial Catalog=TestDatabase;Integrated Security=SSPI;Pooling=false", "TestTable", "ID_"))
     {
         TestObject.Map(x => x.ID, "ID_")
         .Map(x => x.StringValue, "StringValue_", 100)
         .Map(x => x.FloatValue, "FloatValue_")
         .Map(x => x.BoolValue, "BoolValue_")
         .Map(x => x.LongValue, "LongValue_");
         ObjectClass1 TempObject = new ObjectClass1();
         TempObject.StringValue = "Test String";
         TempObject.BoolValue   = true;
         TempObject.FloatValue  = 1234.5f;
         TempObject.LongValue   = 12345;
         TestObject.Save <int>(TempObject);
         TempObject = TestObject.Any();
         Assert.Equal("Test String", TempObject.StringValue);
         Assert.Equal(1234.5f, TempObject.FloatValue);
         Assert.Equal(true, TempObject.BoolValue);
         Assert.Equal(12345, TempObject.LongValue);
         Assert.Equal(1, TempObject.ID);
     }
 }
 public void Any()
 {
     using (Mapping<ObjectClass1> TestObject = new Mapping<ObjectClass1>("Data Source=localhost;Initial Catalog=TestDatabase;Integrated Security=SSPI;Pooling=false", "TestTable", "ID_"))
     {
         TestObject.Map(x => x.ID, "ID_")
             .Map(x => x.StringValue, "StringValue_", 100)
             .Map(x => x.FloatValue, "FloatValue_")
             .Map(x => x.BoolValue, "BoolValue_")
             .Map(x => x.LongValue, "LongValue_")
             .Map(x => x.StringMaxValue, "StringMaxValue_", -1);
         Utilities.Random.Random Rand = new Utilities.Random.Random(12345);
         ObjectClass1 TempObject = new ObjectClass1();
         TempObject.StringValue = "Test String";
         TempObject.BoolValue = true;
         TempObject.FloatValue = 1234.5f;
         TempObject.LongValue = 12345;
         TempObject.StringMaxValue = Rand.Next<string>(new RegexStringGenerator(6000));
         string StringMaxValue = TempObject.StringMaxValue;
         TestObject.Save<int>(TempObject);
         TempObject = TestObject.Any();
         Assert.Equal("Test String", TempObject.StringValue);
         Assert.Equal(1234.5f, TempObject.FloatValue);
         Assert.Equal(true, TempObject.BoolValue);
         Assert.Equal(12345, TempObject.LongValue);
         Assert.Equal(1, TempObject.ID);
         Assert.Equal(StringMaxValue, TempObject.StringMaxValue);
     }
 }
Esempio n. 4
0
 public void Any()
 {
     using (Mapping<ObjectClass1> TestObject = new Mapping<ObjectClass1>("Data Source=localhost;Initial Catalog=TestDatabase;Integrated Security=SSPI;Pooling=false", "TestTable", "ID_"))
     {
         TestObject.Map(x => x.ID, "ID_")
             .Map(x => x.StringValue, "StringValue_", 100)
             .Map(x => x.FloatValue, "FloatValue_")
             .Map(x => x.BoolValue, "BoolValue_")
             .Map(x => x.LongValue, "LongValue_");
         ObjectClass1 TempObject = new ObjectClass1();
         TempObject.StringValue = "Test String";
         TempObject.BoolValue = true;
         TempObject.FloatValue = 1234.5f;
         TempObject.LongValue = 12345;
         TestObject.Save<int>(TempObject);
         TempObject = TestObject.Any();
         Assert.Equal("Test String", TempObject.StringValue);
         Assert.Equal(1234.5f, TempObject.FloatValue);
         Assert.Equal(true, TempObject.BoolValue);
         Assert.Equal(12345, TempObject.LongValue);
         Assert.Equal(1, TempObject.ID);
     }
 }