示例#1
0
        public void ReadingIs5DigitsExpectSuccess()
        {
            MeterCsvValidator validator = new MeterCsvValidator();

            Assert.IsTrue(validator.TryParseMeterReading("12345", out string meterReading));
            Assert.AreEqual("12345", meterReading);
        }
示例#2
0
        public void ReadingIsNotANumberExpectFailure()
        {
            MeterCsvValidator validator = new MeterCsvValidator();

            Assert.IsFalse(validator.TryParseMeterReading("12X45", out string meterReading));
        }
示例#3
0
        public void ReadingIsNegativeExpectFailure()
        {
            MeterCsvValidator validator = new MeterCsvValidator();

            Assert.IsFalse(validator.TryParseMeterReading("-12345", out string meterReading));
        }
示例#4
0
        public void ReadingIsMissingExpectFailure()
        {
            MeterCsvValidator validator = new MeterCsvValidator();

            Assert.IsFalse(validator.TryParseMeterReading("", out string meterReading));
        }
示例#5
0
        public void ReadingIs6DigitsExpectFailure()
        {
            MeterCsvValidator validator = new MeterCsvValidator();

            Assert.IsFalse(validator.TryParseMeterReading("123456", out string meterReading));
        }