Esempio n. 1
0
        public void Invalid_if_no_arguments()
        {
            //IE, this is there we would show help
            var result = ProcessModeHandler.GetMode(new Dictionary <string, string>());

            Assert.That(result, Is.EqualTo(CmdMode.Invalid));
        }
Esempio n. 2
0
        public void Update_Mode_Given_Path()
        {
            var options = new Dictionary <string, string>()
            {
                { UtilCliOptions.DEFAULT, "TestDtos" + Path.DirectorySeparatorChar + "ServiceStackRef.dtos.cs" }
            };
            var result = ProcessModeHandler.GetMode(options);

            Assert.That(result, Is.EqualTo(CmdMode.UpdateReference));
        }
Esempio n. 3
0
        public void Add_Reference_Mode_Given_Just_Url()
        {
            var options = new Dictionary <string, string>()
            {
                { UtilCliOptions.DEFAULT, "http://techstacks.io/" }
            };
            var result = ProcessModeHandler.GetMode(options);

            Assert.That(result, Is.EqualTo(CmdMode.AddReference));
        }
Esempio n. 4
0
        public void Add_Reference_Mode_Given_Url_And_Language()
        {
            var options = new Dictionary <string, string>()
            {
                { UtilCliOptions.DEFAULT, "http://techstacks.io/" },
                { UtilCliOptions.LANG, "FSharp" }
            };
            var result = ProcessModeHandler.GetMode(options);

            Assert.That(result, Is.EqualTo(CmdMode.AddRefWithLang));
        }
Esempio n. 5
0
        public void Add_Reference_Mode_Given_Url_And_Path()
        {
            var options = new Dictionary <string, string>()
            {
                { UtilCliOptions.DEFAULT, "http://techstacks.io/" },
                { UtilCliOptions.FILE, "myfile.dto.cs" }
            };
            var result = ProcessModeHandler.GetMode(options);

            Assert.That(result, Is.EqualTo(CmdMode.AddReferenceWithPath));
        }
Esempio n. 6
0
        public void GetMode_Throws_With_No_Args()
        {
            bool result = false;

            try
            {
                ProcessModeHandler.GetMode(null);
            }
            catch (Exception)
            {
                result = true;
            }

            Assert.That(result);
        }