예제 #1
0
            public void Spec03()
            {
                var target = new JSLintNetSettings();
                target.Ignore.Add("unique");

                var merge = new JSLintNetSettings();
                merge.Ignore.Add("unique");

                target.Merge(merge);

                I.Expect(target.Ignore).ToContain("unique");
                I.Expect(target.Ignore.Count).ToBe(1);
            }
예제 #2
0
            public void Spec02()
            {
                var target = new JSLintNetSettings();
                target.Ignore.Add("target");

                var merge = new JSLintNetSettings();
                merge.Ignore.Add("merge");

                target.Merge(merge);

                I.Expect(target.Ignore).ToContain("target");
                I.Expect(target.Ignore).ToContain("merge");
            }
예제 #3
0
            public void Spec01()
            {
                var target = new JSLintNetSettings()
                {
                    Output = Output.Error
                };

                var merge = new JSLintNetSettings()
                {
                    Output = Output.Message
                };

                target.Merge(merge);

                I.Expect(target.Output).Not.ToBe(Output.Error);
                I.Expect(target.Output).ToBe(Output.Message);
            }
예제 #4
0
            public void Spec04()
            {
                var target = new JSLintNetSettings();
                target.Options = new JSLintOptions()
                {
                    MaximumErrors = 2,
                    AssumeBrowser = true
                };

                var merge = new JSLintNetSettings();
                merge.Options = new JSLintOptions()
                {
                    MaximumErrors = 4,
                    AssumeES6 = true
                };

                target.Merge(merge);

                I.Expect(target.Options.MaximumErrors).ToBe(4);
                I.Expect(target.Options.AssumeBrowser).ToBeTrue();
                I.Expect(target.Options.AssumeES6).ToBeTrue();
                I.Expect(target.Options.TolerateEval).ToBeNull();
            }
            public void Spec04()
            {
                var target = new JSLintNetSettings();
                target.Options = new JSLintOptions()
                {
                    IndentationFactor = 2,
                    AssumeBrowser = true
                };

                var merge = new JSLintNetSettings();
                merge.Options = new JSLintOptions()
                {
                    IndentationFactor = 4,
                    TolerateUnusedParameters = true
                };

                target.Merge(merge);

                I.Expect(target.Options.IndentationFactor).ToBe(4);
                I.Expect(target.Options.AssumeBrowser).ToBeTrue();
                I.Expect(target.Options.TolerateUnusedParameters).ToBeTrue();
                I.Expect(target.Options.TolerateUncapitalizedConstructors).ToBeNull();
            }
예제 #6
0
            public void Spec05()
            {
                var target = new JSLintNetSettings();
                target.Options = null;

                var merge = new JSLintNetSettings();
                merge.Options = new JSLintOptions();

                target.Merge(merge);

                I.Expect(target.Options).Not.ToBeNull();
                I.Expect(target.Options).ToBe(merge.Options);
            }
예제 #7
0
            public void Spec07()
            {
                var target = new JSLintNetSettings();
                target.ErrorLimit = 50;
                target.RunOnBuild = false;
                target.CancelBuild = true;

                var merge = new JSLintNetSettings();
                merge.ErrorLimit = 100;
                merge.RunOnBuild = true;
                merge.RunOnSave = false;

                target.Merge(merge);

                I.Expect(target.ErrorLimit).ToBe(100);
                I.Expect(target.RunOnBuild).ToBeTrue();
                I.Expect(target.CancelBuild).ToBeTrue();
                I.Expect(target.RunOnSave).ToBeFalse();
            }