public void assert_happy_path_with_fubudocs()
        {
            var input = new AddInput
            {
                Profile     = "fubudocs",
                ProjectName = "Right.Docs"
            };

            input.AssertValid();
        }
        public void using_fubudocs_as_the_profile_sets_the_no_tests_flag_to_true()
        {
            var input = new AddInput
            {
                Profile     = "fubudocs",
                ProjectName = "Right.Docs"
            };

            input.NoTestsFlag.ShouldBeTrue();
        }
        public int Add(AddInput input)
        {
            int result = 0;

            foreach (int number in input.Numbers)
            {
                result += number;
            }
            return(result);
        }
        public void assert_happy_path_with_fubudocs()
        {
            var input = new AddInput
            {
                Profile = "fubudocs",
                ProjectName = "Right.Docs"
            };

            input.AssertValid();
        }
        public void adds_a_test_project_by_default()
        {
            var input = new AddInput
            {
                Profile     = "library",
                ProjectName = "Foo"
            };

            var request = AddCommand.BuildTemplateRequest(input, "MyFoo.sln");

            request.TestingProjects.Single()
            .Name.ShouldEqual("Foo.Testing");
        }
        public void assert_failure_if_fubudocs_and_project_name_does_not_end_with_docs()
        {
            var input = new AddInput
            {
                Profile     = "fubudocs",
                ProjectName = "Wrong"
            };

            Exception <ApplicationException> .ShouldBeThrownBy(() => {
                input.AssertValid();
            })
            .Message.ShouldContain("Any FubuDocs project must be named with the '.Docs' suffix");
        }
        public void assert_failure_if_fubudocs_and_project_name_does_not_end_with_docs()
        {
            var input = new AddInput
            {
                Profile = "fubudocs",
                ProjectName = "Wrong"
            };

            Exception<ApplicationException>.ShouldBeThrownBy(() => {
                input.AssertValid();
            })
            .Message.ShouldContain("Any FubuDocs project must be named with the '.Docs' suffix");
        }
        public void adds_a_test_project_by_default()
        {
            var input = new AddInput
            {
                Profile = "library",
                ProjectName = "Foo"
            };

            var request = AddCommand.BuildTemplateRequest(input, "MyFoo.sln");

            request.TestingProjects.Single()
                .Name.ShouldEqual("Foo.Testing");
        }
        public void sets_the_dot_net_version_2()
        {
            var input = new AddInput
            {
                Profile     = "library",
                ProjectName = "Foo",
                DotNetFlag  = DotNetVersion.V40
            };

            var request = AddCommand.BuildTemplateRequest(input, "MyFoo.sln");

            request.Projects.First().Version.ShouldEqual(DotNetVersion.V40);
            request.TestingProjects.First().Version.ShouldEqual(DotNetVersion.V40);
        }
        public void no_tests_if_the_no_testing_flag_is_selected()
        {
            var input = new AddInput
            {
                Profile     = "library",
                ProjectName = "Foo",
                NoTestsFlag = true
            };

            var request = AddCommand.BuildTemplateRequest(input, "MyFoo.sln");

            request.TestingProjects.Any()
            .ShouldBeFalse();
        }
        async Task <Tuple <bool, string> > ExecuteAsyncRefParameterResultsSync(IDbConnection db)
        {
            var input = new AddInput {
                Param1 = 3, Param2 = 4
            };
            IEnumerable <int> parameters = await db.ExecuteAsync(Program.timeout).usp_Add(input);

            if (input.Result != 7)
            {
                return(Tuple.Create(false, $"The value was not set after the stored procedure completed. Expected 7, value is {input.Result}."));
            }
            if (!parameters.SequenceEqual(new[] { 3, 4 }))
            {
                return(Tuple.Create(false, $"Expected the input values to be returned from the stored procedure. Expected [3,4], received [{ string.Join(",", parameters.Select(i => i.ToString())) }]"));
            }

            return(Tuple.Create(true, ""));
        }
        /// <summary>
        /// 新增文件到用户自定义空间
        /// </summary>
        /// <param name="input">新增文件到用户自定义空间</param>
        /// <returns></returns>
        public async Task <AddResult> Add(AddInput input)
        {
            Dictionary <string, string> pairs = new Dictionary <string, string> {
                { "agent_id", input.AgentId },
                { "code", input.Code },
                { "media_id", input.MediaId },
                { "space_id", input.SpaceId },
                { "folder_id", input.FolderId },
                { "name", input.Name },
                { "path", input.Path }
            };

            if (input.Overwrite.HasValue)
            {
                pairs.Add("overwrite", input.Overwrite.ToString());
            }

            return(await Get <AddResult>("cspace/add?access_token={ACCESS_TOKEN}", pairs));
        }
        public void sets_the_dot_net_version_2()
        {
            var input = new AddInput
            {
                Profile = "library",
                ProjectName = "Foo",
                DotNetFlag = DotNetVersion.V40
            };

            var request = AddCommand.BuildTemplateRequest(input, "MyFoo.sln");
            request.Projects.First().Version.ShouldEqual(DotNetVersion.V40);
            request.TestingProjects.First().Version.ShouldEqual(DotNetVersion.V40);
        }
        public void no_tests_if_the_no_testing_flag_is_selected()
        {
            var input = new AddInput
            {
                Profile = "library",
                ProjectName = "Foo",
                NoTestsFlag = true
            };

            var request = AddCommand.BuildTemplateRequest(input, "MyFoo.sln");
            request.TestingProjects.Any()
                .ShouldBeFalse();
        }
        public void using_fubudocs_as_the_profile_sets_the_no_tests_flag_to_true()
        {
            var input = new AddInput
            {
                Profile = "fubudocs",
                ProjectName = "Right.Docs"
            };

            input.NoTestsFlag.ShouldBeTrue();
        }
Exemple #16
0
 public async Task <bool> GeoAddAsync(AddInput input)
 {
     return(await IGeoServer.GeoAddAsync(input));
 }
 public ActionResult <int> Add(AddInput input)
 {
     return(_calculator.Add(input));
 }