Beispiel #1
0
        public void ShouldContainParametersTypeInExceptionMessage(EqualityOperatorOverloadAssertion sut)
        {
            var exception = Record.Exception(() => sut.Verify(typeof(ClassWhichDoesNotOverloadsEqualityOperator)));

            Assert.Contains(
                string.Format("with parameters of type {0}", typeof(ClassWhichDoesNotOverloadsEqualityOperator).Name),
                exception.Message);
        }
 public void ShouldBeIdiomaticAssertion(EqualityOperatorOverloadAssertion sut)
 {
     Assert.IsAssignableFrom <IdiomaticAssertion>(sut);
 }
Beispiel #3
0
        public void ShouldContainTypeInExceptionMessage(EqualityOperatorOverloadAssertion sut)
        {
            var exception = Record.Exception(() => sut.Verify(typeof(ClassWhichDoesNotOverloadsEqualityOperator)));

            Assert.Contains(typeof(ClassWhichDoesNotOverloadsEqualityOperator).Name, exception.Message);
        }
Beispiel #4
0
 public void ShouldThrowWhenEqualityOperatorIsOverloadedWithArgumentsOtherThanContainingType(
     EqualityOperatorOverloadAssertion sut)
 {
     EqualityTestAssert.ExceptionWasThrownForTestType
     <EqualityOperatorException, ClassThatOverloadsEqualityOperatorWithArgumentsOtherThanContainingType>(sut);
 }
Beispiel #5
0
 public void ShouldThrowWhenEqualityOperatorIsNotOverloaded(EqualityOperatorOverloadAssertion sut)
 {
     EqualityTestAssert
     .ExceptionWasThrownForTestType <EqualityOperatorException, ClassWhichDoesNotOverloadsEqualityOperator>(
         sut);
 }
Beispiel #6
0
 public void ShouldNotThrowWhenEqualityOperatorIsOverloaded(EqualityOperatorOverloadAssertion sut)
 {
     EqualityTestAssert.ExceptionWasNotThrownForTestType <ClassWhichOverloadsEqualityOperator>(sut);
 }