public void ConvertStrToInt_V1() { var allDigitStr = ConstrainedSomething.Create("123"); var actual = ConvertStrToInt.ConvertStrToInt_V1(allDigitStr); const int expected = 123; Assert.AreEqual(expected, actual); }
public void ConvertStrToInt_V2() { var actual = ConvertStrToInt.ConvertStrToInt_V2("123"); Assert.IsTrue(actual.HasValue); const int expected = 123; Assert.AreEqual(expected, actual.Value); }