Пример #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));
        }
Пример #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));
        }
Пример #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));
        }
Пример #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));
        }
Пример #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));
        }
Пример #6
0
        public void GetMode_Throws_With_No_Args()
        {
            bool result = false;

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

            Assert.That(result);
        }