Exemple #1
0
        public void ThrowException_WhenIntFromStringMethod_IsProvidedLongNumber()
        {
            //Arrange
            var fakeWriter    = new Mock <IWriter>();
            var mockValidator = new ValidateCore(fakeWriter.Object);

            //Act & Assert
            Assert.ThrowsException <ArgumentException>(() => mockValidator.IntFromString("736283763187463284", "parameter"));
        }
Exemple #2
0
        public void ParsesCorrectValue_WhenIntFromStringMethod_IsProvidedValidIntegerNumber()
        {
            //Arrange
            var fakeWriter     = new Mock <IWriter>();
            var mockValidator  = new ValidateCore(fakeWriter.Object);
            int expectedNumber = 7384;

            //Act & Assert
            Assert.AreEqual(expectedNumber, mockValidator.IntFromString(expectedNumber.ToString(), "parameter"));
        }