Beispiel #1
0
        public void ctor_systemType()
        {
            Type   expected        = typeof(string);
            string expectedmessage = string.Format(CultureInfo.CurrentCulture, "ContractAttribute missing on type: {0}.", expected.FullName);

            MissingContractAttributeException target = this.CreateMock(expected);

            Assert.AreEqual <string>(expectedmessage, target.Message);
            Assert.AreEqual <Type>(expected, target.TargetType);
        }
Beispiel #2
0
        protected override void AssertAreEqual(Exception ex1, Exception ex2)
        {
            base.AssertAreEqual(ex1, ex2);

            MissingContractAttributeException mex1 = ex1 as MissingContractAttributeException;
            MissingContractAttributeException mex2 = ex2 as MissingContractAttributeException;

            Assert.IsNotNull(mex1);
            Assert.IsNotNull(mex2);

            Assert.AreEqual <Type>(mex1.TargetType, mex2.TargetType);
        }