示例#1
0
        public void ConvertStrToInt_V1()
        {
            var       allDigitStr = ConstrainedSomething.Create("123");
            var       actual      = ConvertStrToInt.ConvertStrToInt_V1(allDigitStr);
            const int expected    = 123;

            Assert.AreEqual(expected, actual);
        }
示例#2
0
        public void ConvertStrToInt_V2()
        {
            var actual = ConvertStrToInt.ConvertStrToInt_V2("123");

            Assert.IsTrue(actual.HasValue);
            const int expected = 123;

            Assert.AreEqual(expected, actual.Value);
        }