public void CascadeSave() { var TempObject = new TestClass(); TempObject.A = "ASDF"; TempObject.ID = 1; var TestObject = new Utilities.ORM.Manager.Mapper.Default.Reference <TestClass, string>(x => x.A, new TestClassMapping()); var Result = TestObject.CascadeSave(TempObject, new Utilities.ORM.Manager.SourceProvider.Manager(Utilities.IoC.Manager.Bootstrapper.ResolveAll <IDatabase>()).GetSource("ReferenceTest"), new List <object>()); Assert.NotNull(Result); Assert.Equal("", Result.ToString()); Assert.Equal(0, Result.CommandCount); }
public void Create() { var TestObject = new Utilities.ORM.Manager.Mapper.Default.Reference <TestClass, string>(x => x.A, new TestClassMapping()); Assert.False(TestObject.AutoIncrement); Assert.False(TestObject.Cascade); Assert.NotNull(TestObject.CompiledExpression); Assert.NotNull(TestObject.DefaultValue); Assert.Equal(null, TestObject.DefaultValue()); Assert.Equal("_ADerived", TestObject.DerivedFieldName); Assert.NotNull(TestObject.Expression); Assert.Equal("A_", TestObject.FieldName); Assert.Null(TestObject.ForeignMapping); Assert.False(TestObject.Index); Assert.NotNull(TestObject.Mapping); Assert.Equal(100, TestObject.MaxLength); Assert.Equal("A", TestObject.Name); Assert.False(TestObject.NotNull); Assert.Equal("TestClass_", TestObject.TableName); Assert.Equal(typeof(string), TestObject.Type); Assert.False(TestObject.Unique); }