Exemple #1
0
        public void FormatPlate_Ignores_IncorrectDashes()
        {
            var target = new LicenseplateValidator();

            target.FormatPlate("1234AB", "NL", true);
            target.FormatPlate("1-23-4AB", "NL", true);
        }
Exemple #2
0
        public void FormatPlate_Throws_OnUnknownSideCode()
        {
            var target = new LicenseplateValidator();

            target.FormatPlate("1A2B3C", "NL");
        }
Exemple #3
0
        public void FormatPlate_Throws_OnEmptyPlate()
        {
            var target = new LicenseplateValidator();

            target.FormatPlate("   ", "NL");
        }
Exemple #4
0
        public void FormatPlate_Throws_OnNullPlate()
        {
            var target = new LicenseplateValidator();

            target.FormatPlate(null, "NL");
        }
Exemple #5
0
        public void FormatPlate_Throws_OnIncorrectDashes()
        {
            var target = new LicenseplateValidator();

            target.FormatPlate("1234AB", "NL", false);
        }
Exemple #6
0
        public void FormatPlate_Throws_OnUnsupportedCountry()
        {
            var target = new LicenseplateValidator();

            target.FormatPlate("1234AB", "XX");
        }
Exemple #7
0
        public void FormatPlate_Returns_CorrectResults()
        {
            var target = new LicenseplateValidator();

            Assert.AreEqual("AB-12-34", target.FormatPlate("AB1234", "NL"));
            Assert.AreEqual("12-34-AB", target.FormatPlate("1234AB", "NL"));
            Assert.AreEqual("12-AB-34", target.FormatPlate("12AB34", "NL"));
            Assert.AreEqual("AB-12-CD", target.FormatPlate("AB12CD", "NL"));
            Assert.AreEqual("AB-CD-12", target.FormatPlate("ABCD12", "NL"));
            Assert.AreEqual("12-AB-CD", target.FormatPlate("12ABCD", "NL"));
            Assert.AreEqual("12-ABC-3", target.FormatPlate("12ABC3", "NL"));
            Assert.AreEqual("1-ABC-23", target.FormatPlate("1ABC23", "NL"));
            Assert.AreEqual("AB-123-C", target.FormatPlate("AB123C", "NL"));
            Assert.AreEqual("A-123-BC", target.FormatPlate("A123BC", "NL"));
            Assert.AreEqual("ABC-12-D", target.FormatPlate("ABC12D", "NL"));

            Assert.AreEqual("AB-12-34", target.FormatPlate("AB 12 34", "NL"));
            Assert.AreEqual("12-34-AB", target.FormatPlate("1-2-3-4 AB", "NL"));

            Assert.AreEqual("AB-12-34", target.FormatPlate("AB-12-34", "NL", false));
            Assert.AreEqual("12-34-AB", target.FormatPlate("12-34-AB", "NL", false));
        }