Exemple #1
0
        public void Test_05_TwoArguments_TwoDefault()
        {
            TwoArguments Obj = Types.Instantiate <TwoArguments>(false);

            Assert.IsNotNull(Obj);
            Assert.AreEqual(0, Obj.N);
            Assert.AreEqual(string.Empty, Obj.S);
        }
Exemple #2
0
        public void Test_03_TwoArguments()
        {
            TwoArguments Obj = Types.Instantiate <TwoArguments>(false, 1, "Hello");

            Assert.IsNotNull(Obj);
            Assert.AreEqual(1, Obj.N);
            Assert.AreEqual("Hello", Obj.S);
        }
Exemple #3
0
        public void Test_16_NullArguments()
        {
            TwoArguments Obj = Types.Instantiate <TwoArguments>(false, 1, null);

            Assert.IsNotNull(Obj);
            Assert.AreEqual(1, Obj.N);
            Assert.IsNull(Obj.S);
        }
Exemple #4
0
        public void TestTwoArguments()
        {
            var args = new TwoArguments();

            Arguments.Parse(new string[] { "/port", "COM3", "/speed", "115200" }, args);

            Assert.AreEqual("COM3", args.Port);
            Assert.AreEqual(115200, args.Speed);
        }
Exemple #5
0
        public void TestDescriptions()
        {
            var args = new TwoArguments();

            var descriptionText = Arguments.GetDescriptionText(args);

            Assert.AreEqual(@"/port Select the COM port to use
/speed Select the COM port baud rate
", descriptionText);
        }
Exemple #6
0
        public void TestArgumentsWithStuffLeftAfterArguments()
        {
            var args = new TwoArguments();

            var remainingArgs = Arguments.Parse(new string[] { "/port", "COM3", "/speed", "115200", "bootloader.bit" }, args);

            Assert.AreEqual("COM3", args.Port);
            Assert.AreEqual(115200, args.Speed);

            AssertArraysAreEqual(new string[] { "bootloader.bit" }, remainingArgs);
        }