コード例 #1
0
        public void ConstructWithParametersBuildDataSetUpMethodTestObjectMemberFieldTestObjectNameTestObjectTypeTest()
        {
            this.buildData             = new NStub.CSharp.ObjectGeneration.BuildDataDictionary();
            this.setUpMethod           = new System.CodeDom.CodeMemberMethod();
            this.testObjectMemberField = new System.CodeDom.CodeMemberField();
            this.testObjectName        = "myTestObjectName";
            this.testObjectType        = typeof(object);
            this.testObject            = new TestObjectComposer(this.buildData, this.setUpMethod, this.testObjectMemberField, this.testObjectName, this.testObjectType);

            Assert.Throws <ArgumentNullException>(() => new TestObjectComposer(null, this.setUpMethod, this.testObjectMemberField, this.testObjectName, this.testObjectType));
            Assert.Throws <ArgumentNullException>(() => new TestObjectComposer(this.buildData, null, this.testObjectMemberField, this.testObjectName, this.testObjectType));
            Assert.Throws <ArgumentNullException>(() => new TestObjectComposer(this.buildData, this.setUpMethod, null, this.testObjectName, this.testObjectType));
            Assert.Throws <ArgumentNullException>(() => new TestObjectComposer(this.buildData, this.setUpMethod, this.testObjectMemberField, null, this.testObjectType));
            Assert.Throws <ArgumentException>(() => new TestObjectComposer(this.buildData, this.setUpMethod, this.testObjectMemberField, string.Empty, this.testObjectType));
            Assert.Throws <ArgumentNullException>(() => new TestObjectComposer(this.buildData, this.setUpMethod, this.testObjectMemberField, this.testObjectName, null));
        }
コード例 #2
0
        public void ConstructWithParametersBuildDataSetUpMethodTestObjectMemberFieldTestObjectNameTestObjectTypeTest()
        {
            this.buildData = new NStub.CSharp.ObjectGeneration.BuildDataDictionary();
            this.setUpMethod = new System.CodeDom.CodeMemberMethod();
            this.testObjectMemberField = new System.CodeDom.CodeMemberField();
            this.testObjectName = "myTestObjectName";
            this.testObjectType = typeof(object);
            this.testObject = new TestObjectComposer(this.buildData, this.setUpMethod, this.testObjectMemberField, this.testObjectName, this.testObjectType);

            Assert.Throws<ArgumentNullException>(() => new TestObjectComposer(null, this.setUpMethod, this.testObjectMemberField, this.testObjectName, this.testObjectType));
            Assert.Throws<ArgumentNullException>(() => new TestObjectComposer(this.buildData, null, this.testObjectMemberField, this.testObjectName, this.testObjectType));
            Assert.Throws<ArgumentNullException>(() => new TestObjectComposer(this.buildData, this.setUpMethod, null, this.testObjectName, this.testObjectType));
            Assert.Throws<ArgumentNullException>(() => new TestObjectComposer(this.buildData, this.setUpMethod, this.testObjectMemberField, null, this.testObjectType));
            Assert.Throws<ArgumentException>(() => new TestObjectComposer(this.buildData, this.setUpMethod, this.testObjectMemberField, string.Empty, this.testObjectType));
            Assert.Throws<ArgumentNullException>(() => new TestObjectComposer(this.buildData, this.setUpMethod, this.testObjectMemberField, this.testObjectName, null));
        }
コード例 #3
0
        public void EqualsTest()
        {
            var second = new TestObjectComposer(
                this.buildData,
                this.setUpMethod,
                this.testObjectMemberField,
                this.testObjectName,
                this.testObjectType);

            Assert.IsTrue(testObject.Equals(second));
            Assert.IsTrue(second.GetHashCode() == testObject.GetHashCode());

            second = new TestObjectComposer(
                this.buildData,
                this.setUpMethod,
                this.testObjectMemberField,
                this.testObjectName + "XYZ",
                this.testObjectType);

            Assert.IsFalse(testObject.Equals(second));
            testObject.BuildTestObject(MemberVisibility.Public);
            Assert.IsFalse(second.GetHashCode() == testObject.GetHashCode());
        }
コード例 #4
0
        public void EqualsTest()
        {
            var second = new TestObjectComposer(
                this.buildData,
                this.setUpMethod,
                this.testObjectMemberField,
                this.testObjectName,
                this.testObjectType);

            Assert.IsTrue(testObject.Equals(second));
            Assert.IsTrue(second.GetHashCode() == testObject.GetHashCode());

            second = new TestObjectComposer(
                this.buildData,
                this.setUpMethod,
                this.testObjectMemberField,
                this.testObjectName + "XYZ",
                this.testObjectType);

            Assert.IsFalse(testObject.Equals(second));
            testObject.BuildTestObject(MemberVisibility.Public);
            Assert.IsFalse(second.GetHashCode() == testObject.GetHashCode());
        }
コード例 #5
0
 public void TearDown()
 {
     this.testObject = null;
 }
コード例 #6
0
 public void TearDown()
 {
     this.testObject = null;
 }