示例#1
0
        public void EnforceRule_Throws_An_ValidationException_When_Identity_Is_Null()
        {
            // Arrange
            var sut = new ExistsIdentitySpecification();

            // Assert
            Assert.Throws <ValidationException>(() => sut.EnforceRule(null, It.IsAny <string>()));
        }
示例#2
0
        public void EnforceRule_Does_Not_Throw_Any_Exception_When_Identity_Is_Not_Null()
        {
            // Arrange
            var sut = new ExistsIdentitySpecification();
            // Act
            var exception = Record.Exception(() => sut.EnforceRule(NewIdentity(), It.IsAny <string>()));

            // Assert
            Assert.Null(exception);
        }