public void AnyByID() { var TempGuid = Guid.NewGuid(); var TestObject = new Utilities.ORM.Manager.Session(); for (int x = 0; x < 100; ++x) { var TempObject = new TestClass(); TempObject.BoolReference = true; TempObject.ByteArrayReference = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; TempObject.ByteReference = 12; TempObject.CharReference = 'v'; TempObject.DecimalReference = 1.4213m; TempObject.DoubleReference = 1.32645d; TempObject.EnumReference = TestEnum.Value2; TempObject.FloatReference = 1234.5f; TempObject.GuidReference = TempGuid; TempObject.IntReference = 145145; TempObject.LongReference = 763421; TempObject.NullStringReference = null; TempObject.ShortReference = 5423; TempObject.StringReference = "agsdpghasdg"; TestObject.Save <TestClass, int>(TempObject); } var Item = TestObject.Any <TestClass, int>(10); Assert.Equal(10, Item.ID); Assert.Equal(true, Item.BoolReference); Assert.Equal(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, Item.ByteArrayReference); Assert.Equal(12, Item.ByteReference); Assert.Equal('v', Item.CharReference); Assert.Equal(1.4213m, Item.DecimalReference); Assert.Equal(1.32645d, Item.DoubleReference); Assert.Equal(TestEnum.Value2, Item.EnumReference); Assert.Equal(1234.5f, Item.FloatReference); Assert.Equal(TempGuid, Item.GuidReference); Assert.Equal(145145, Item.IntReference); Assert.Equal(763421, Item.LongReference); Assert.Equal(null, Item.NullStringReference); Assert.Equal(5423, Item.ShortReference); Assert.Equal("agsdpghasdg", Item.StringReference); Item = TestObject.Any <TestClass, int>(20); Assert.Equal(20, Item.ID); Assert.Equal(true, Item.BoolReference); Assert.Equal(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, Item.ByteArrayReference); Assert.Equal(12, Item.ByteReference); Assert.Equal('v', Item.CharReference); Assert.Equal(1.4213m, Item.DecimalReference); Assert.Equal(1.32645d, Item.DoubleReference); Assert.Equal(TestEnum.Value2, Item.EnumReference); Assert.Equal(1234.5f, Item.FloatReference); Assert.Equal(TempGuid, Item.GuidReference); Assert.Equal(145145, Item.IntReference); Assert.Equal(763421, Item.LongReference); Assert.Equal(null, Item.NullStringReference); Assert.Equal(5423, Item.ShortReference); Assert.Equal("agsdpghasdg", Item.StringReference); }
public void Delete() { var TempGuid = Guid.NewGuid(); var TestObject = new Utilities.ORM.Manager.Session(); for (int x = 0; x < 100; ++x) { var TempObject = new TestClass(); TempObject.BoolReference = true; TempObject.ByteArrayReference = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; TempObject.ByteReference = 12; TempObject.CharReference = 'v'; TempObject.DecimalReference = 1.4213m; TempObject.DoubleReference = 1.32645d; TempObject.EnumReference = TestEnum.Value2; TempObject.FloatReference = 1234.5f; TempObject.GuidReference = TempGuid; TempObject.IntReference = 145145; TempObject.LongReference = 763421; TempObject.NullStringReference = null; TempObject.ShortReference = 5423; TempObject.StringReference = "agsdpghasdg"; TestObject.Save <TestClass, int>(TempObject); } TestObject.Delete(TestObject.Any <TestClass>()); var ItemList = TestObject.All <TestClass>(); Assert.Equal(99, ItemList.Count()); }