public static IEnumerable<ReferenceDataContractType> GetTestData()
        {
            ReferenceDataContractType first = new ReferenceDataContractType();
            ReferenceDataContractType second = new ReferenceDataContractType(first);
            first.Other = second;

            return new ReferenceDataContractType[] {
                new ReferenceDataContractType(),
                new ReferenceDataContractType(new ReferenceDataContractType()),
                first};
        }
        public static IEnumerable <ReferenceDataContractType> GetTestData()
        {
            ReferenceDataContractType first  = new ReferenceDataContractType();
            ReferenceDataContractType second = new ReferenceDataContractType(first);

            first.Other = second;

            return(new ReferenceDataContractType[] {
                new ReferenceDataContractType(),
                new ReferenceDataContractType(new ReferenceDataContractType()),
                first
            });
        }
Example #3
0
        /// <summary>
        /// Asserts the two given <see cref="ReferenceDataContractType"/> instances are equal.
        /// </summary>
        /// <param name="expected">The expected value.</param>
        /// <param name="actual">The actual value.</param>
        /// <param name="failureMessage">Message to prefix to assertion failures.</param>
        public static void AreEqual(ReferenceDataContractType expected, ReferenceDataContractType actual, string failureMessage)
        {
            if (expected == null)
            {
                Assert.IsNull(actual, string.Format("{0}  actual value was not null but expected value was.", failureMessage));
            }

            Assert.IsNotNull(actual, string.Format("{0}  actual value was null but expected value was not.", failureMessage));

            Assert.AreEqual(expected.GetType(), actual.GetType(), string.Format("{0}  actual value was not of the same type as the expected.", failureMessage));

            ReferenceDataContractType expectedOther = expected.Other;
            ReferenceDataContractType actualOther = actual.Other;

            if (expectedOther == null)
            {
                Assert.IsNull(actualOther, string.Format("{0}  actual.Other was not null but expected.Other was.", failureMessage));
            }
            else
            {
                Assert.IsNotNull(actualOther, string.Format("{0}  actual.Other was null but expected.Other was not.", failureMessage));
                Assert.AreEqual(expectedOther.GetType(), actualOther.GetType(), string.Format("{0}  the 'Other' properties contained objects of different types.", failureMessage));
            }
        }
 public ReferenceDataContractType(ReferenceDataContractType other)
 {
     this.other = other;
 }
 public ReferenceDataContractType(ReferenceDataContractType other)
 {
     this.other = other;
 }