public void ThrowException_WhenDecimalFromStringMethod_IsProvidedInvalidDecimalNumber() { //Arrange var fakeWriter = new Mock <IWriter>(); var mockValidator = new ValidateCore(fakeWriter.Object); //Act & Assert Assert.ThrowsException <ArgumentException>(() => mockValidator.DecimalFromString("7362837631885984375874353457463284", "parameter")); }
public void ParsesCorrectValue_WhenDecimalFromStringMethod_IsProvidedValidDecimalNumber() { //Arrange var fakeWriter = new Mock <IWriter>(); var mockValidator = new ValidateCore(fakeWriter.Object); decimal expectedNumber = 73811430193474; //Act & Assert Assert.AreEqual(expectedNumber, mockValidator.DecimalFromString("73811430193474", "parameter")); }