コード例 #1
0
        private void AssertHandlerComparison(Type handlerClass, object smaller, object greater
                                             )
        {
            IComparable4 handler = (IComparable4)NewInstance(handlerClass);

            AssertHandlerComparison(handler, smaller, greater);
        }
コード例 #2
0
		private void AssertHandlerComparison(IComparable4 handler, object smaller, object
			 greater)
		{
			IPreparedComparison comparable = handler.PrepareComparison(Context(), smaller);
			Assert.IsNotNull(comparable);
			Assert.AreEqual(0, comparable.CompareTo(smaller));
			Assert.IsSmaller(0, comparable.CompareTo(greater));
			comparable = handler.PrepareComparison(Context(), greater);
			Assert.IsNotNull(comparable);
			Assert.AreEqual(0, comparable.CompareTo(greater));
			Assert.IsGreater(0, comparable.CompareTo(smaller));
			comparable = handler.PrepareComparison(Context(), null);
			Assert.IsNotNull(comparable);
			Assert.AreEqual(0, comparable.CompareTo(null));
			Assert.IsSmaller(0, comparable.CompareTo(smaller));
		}
コード例 #3
0
        private void AssertHandlerComparison(IComparable4 handler, object smaller, object
                                             greater)
        {
            IPreparedComparison comparable = handler.PrepareComparison(Context(), smaller);

            Assert.IsNotNull(comparable);
            Assert.AreEqual(0, comparable.CompareTo(smaller));
            Assert.IsSmaller(0, comparable.CompareTo(greater));
            comparable = handler.PrepareComparison(Context(), greater);
            Assert.IsNotNull(comparable);
            Assert.AreEqual(0, comparable.CompareTo(greater));
            Assert.IsGreater(0, comparable.CompareTo(smaller));
            comparable = handler.PrepareComparison(Context(), null);
            Assert.IsNotNull(comparable);
            Assert.AreEqual(0, comparable.CompareTo(null));
            Assert.IsSmaller(0, comparable.CompareTo(smaller));
        }