예제 #1
0
        public void SocialNumber_IsValid_ReturnTrueForValidValue()
        {
            //Arrange
            //Act
            var result = SocialNumber.IsValid("52812349000");

            //Assert
            Assert.True(result);
        }
예제 #2
0
        public void SocialNumber_Constructor_ThrowsExceptionForNullValues()
        {
            //Arrange
            //Act
            //Assert
            var ex = Assert.Throws <ArgumentNullException>(() => SocialNumber.FromString(null));

            Assert.Equal("Value cannot be null. (Parameter 'value')", ex.Message);
        }
예제 #3
0
        public void SocialNumber_Constructor_InstanceValidValue()
        {
            //Arrange
            //Act
            var socialNumber = SocialNumber.FromString("203.660.060-37");

            //Assert
            Assert.NotNull(socialNumber);
        }
예제 #4
0
        public void SocialNumber_Constructor_ThrowsExceptionForInvalidValues(string value)
        {
            //Arrange
            //Act
            //Assert
            var ex = Assert.Throws <ArgumentException>(() => SocialNumber.FromString(value));

            Assert.Equal($"Invalid number [{value}]", ex.Message);
        }
예제 #5
0
        public void SocialNumber_IsValid_ReturnTrueForValidValues(string value)
        {
            //Arrange
            //Act
            var result = SocialNumber.IsValid(value);

            //Assert
            Assert.True(result);
        }