Пример #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));
        }