示例#1
0
        public static object LogHashCode(this object value)
        {
            string message = string.Format("{0} <{1}>", value.GetHashCode(), value.GetType().Name);

            AssertHelper.WriteLine(message);
            return(value);
        }
示例#2
0
        public static T LogHashCodes <T>(this T value, object value2)
        {
            string message = string.Format("{0} <{1}> {2} {3}<{4}>", value.GetHashCode(), value.GetType().Name, value.Equals(value2) ? "==" : "!=", value2.GetHashCode(), value2.GetType().Name);

            AssertHelper.WriteLine(message);
            return(value);
        }
示例#3
0
        public static object LogHashCodeWiths(this object value, object value2)
        {
            string message = string.Format("{0} <{1}> {2} {3}<{4}>", value.GetHashCode(), value.GetType().Name, value == value2 ? "==" : "!=", value2.GetHashCode(), value2.GetType().Name);

            AssertHelper.WriteLine(message);
            return(value);
        }
示例#4
0
        public static MockTask Create()
        {
            var mockTask = new MockTask();

            mockTask.MockAction = () =>
            {
                mockTask.InvokeCount++;
                AssertHelper.WriteLine("task running at: " + DateTime.Now.ToString("yyyyMMdd HH:mm:ss:fff"));
            };
            return(mockTask);
        }
示例#5
0
        public static object ShouldNotSame(this object value, object expectedValue)
        {
            if (value == null || expectedValue == null)
            {
                Assert.AreNotSame(expectedValue, value);
                return(value);
            }
            string message = string.Format("Should Not Same [{0}] => <{1}> : <{2}>", value.GetType().Name, value.GetHashCode(), expectedValue.GetHashCode());

            Assert.AreNotSame(expectedValue, value, message.WithKoPrefix());
            AssertHelper.WriteLine(message.WithOkPrefix());
            return(value);
        }