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)); }
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)); }
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()); }
public void TearDown() { this.testObject = null; }