Ejemplo n.º 1
0
        public void SutIsException()
        {
            // Arrange
            var dummyMember    = typeof(object).GetMembers().First();
            var dummyValueType = typeof(object);
            // Act
            var sut = new GuardClauseException();

            // Assert
            Assert.IsAssignableFrom <Exception>(sut);
        }
        public void SutIsException()
        {
            // Fixture setup
            var dummyMember    = typeof(object).GetMembers().First();
            var dummyValueType = typeof(object);
            // Exercise system
            var sut = new GuardClauseException();

            // Verify outcome
            Assert.IsAssignableFrom <Exception>(sut);
            // Teardown
        }
Ejemplo n.º 3
0
        public void MessageIsNotNull()
        {
            // Arrange
            var dummyMember    = typeof(object).GetMembers().First();
            var dummyValueType = typeof(object);
            var sut            = new GuardClauseException();
            // Act
            var result = sut.Message;

            // Assert
            Assert.NotNull(result);
        }
        public void MessageIsNotNull()
        {
            // Fixture setup
            var dummyMember    = typeof(object).GetMembers().First();
            var dummyValueType = typeof(object);
            var sut            = new GuardClauseException();
            // Exercise system
            var result = sut.Message;

            // Verify outcome
            Assert.NotNull(result);
            // Teardown
        }
Ejemplo n.º 5
0
        public void MessageIsCorrectWhenConstructedWithMessage()
        {
            // Arrange
            var dummyMember     = typeof(object).GetMembers().First();
            var dummyValueType  = typeof(object);
            var expectedMessage = Guid.NewGuid().ToString();
            var sut             = new GuardClauseException(expectedMessage);
            // Act
            var result = sut.Message;

            // Assert
            Assert.Equal(expectedMessage, result);
        }
        public void MessageIsCorrectWhenConstructedWithMessage()
        {
            // Fixture setup
            var dummyMember     = typeof(object).GetMembers().First();
            var dummyValueType  = typeof(object);
            var expectedMessage = Guid.NewGuid().ToString();
            var sut             = new GuardClauseException(expectedMessage);
            // Exercise system
            var result = sut.Message;

            // Verify outcome
            Assert.Equal(expectedMessage, result);
            // Teardown
        }
Ejemplo n.º 7
0
        public void InnerExceptionIsCorrectWhenConstructedWithMessageAndInnerException()
        {
            // Arrange
            var dummyMember    = typeof(object).GetMembers().First();
            var dummyValueType = typeof(object);
            var dummyMessage   = "Anonymous text";
            var expectedInner  = new Exception();
            var sut            = new GuardClauseException(dummyMessage, expectedInner);
            // Act
            var result = sut.InnerException;

            // Assert
            Assert.Equal(expectedInner, result);
        }
        public void InnerExceptionIsCorrectWhenConstructedWithMessageAndInnerException()
        {
            // Fixture setup
            var dummyMember    = typeof(object).GetMembers().First();
            var dummyValueType = typeof(object);
            var dummyMessage   = "Anonymous text";
            var expectedInner  = new Exception();
            var sut            = new GuardClauseException(dummyMessage, expectedInner);
            // Exercise system
            var result = sut.InnerException;

            // Verify outcome
            Assert.Equal(expectedInner, result);
            // Teardown
        }