WithAssemblyName() публичный Метод

public WithAssemblyName ( string assemblyName ) : ClassDefBuilder
assemblyName string
Результат ClassDefBuilder
Пример #1
0
        public void Test_CreateClassDef_AddOnePropDef()
        {
            //---------------Set up test pack-------------------
            string assemblyName = "A" + RandomValueGenerator.GetRandomString();
            string className    = "C" + RandomValueGenerator.GetRandomString();
            string propertyName = "P" + RandomValueGenerator.GetRandomString();
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var      classDefBuilder = new ClassDefBuilder();
            ClassDef classDef        = classDefBuilder.WithAssemblyName(assemblyName).WithClassName(className)
                                       .AddPropDef(new PropDefBuilder()
                                                   .WithPropertyName(propertyName));

            //---------------Test Result -----------------------
            Assert.AreEqual(assemblyName, classDef.AssemblyName);
            Assert.AreEqual(className, classDef.ClassName);
            Assert.IsNotNull(classDef.PropDefcol);
            Assert.AreEqual(1, classDef.PropDefcol.Count());
            Assert.IsNotNull(classDef.PropDefcol[propertyName]);
            Assert.IsNull(classDef.PrimaryKeyDef);
            Assert.IsNull(classDef.KeysCol);
            Assert.IsNull(classDef.RelationshipDefCol);
            Assert.AreEqual(0, classDef.UIDefCol.Count());
        }
        public void Test_CreateClassDef_AddOnePropDef()
        {
            //---------------Set up test pack-------------------
            string assemblyName = "A" + RandomValueGenerator.GetRandomString();
            string className = "C" + RandomValueGenerator.GetRandomString();
            string propertyName = "P" + RandomValueGenerator.GetRandomString();
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var classDefBuilder = new ClassDefBuilder();
            ClassDef classDef = classDefBuilder.WithAssemblyName(assemblyName).WithClassName(className)
                            .AddPropDef(new PropDefBuilder()
                                        .WithPropertyName(propertyName));
            //---------------Test Result -----------------------
            Assert.AreEqual(assemblyName, classDef.AssemblyName);
            Assert.AreEqual(className, classDef.ClassName);
            Assert.IsNotNull(classDef.PropDefcol);
            Assert.AreEqual(1, classDef.PropDefcol.Count());
            Assert.IsNotNull(classDef.PropDefcol[propertyName]);
            Assert.IsNull(classDef.PrimaryKeyDef);
            Assert.IsNull(classDef.KeysCol);
            Assert.IsNull(classDef.RelationshipDefCol);
            Assert.AreEqual(0, classDef.UIDefCol.Count());
        }