public void Spec10() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file1.js", 2); testable.SetupJSLintFile("file2.js", 0); testable.SetupJSLintFile("file3.js", 3); testable.Instance.Execute(); I.Expect(testable.Instance.ErrorFileCount).ToBe(2); } }
public void Spec14() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file1.js", 3); testable.SetupJSLintFile("file2.js", 5); testable.Instance.Execute(); testable.JSLintReportBuilderMock.Verify(x => x.AddFile(It.Is <string>(y => y.EndsWith("file1.js")), It.IsAny <IJSLintData>())); testable.JSLintReportBuilderMock.Verify(x => x.AddFile(It.Is <string>(y => y.EndsWith("file2.js")), It.IsAny <IJSLintData>())); } }
public void Spec04() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file1.js", 5); testable.SetupJSLintFile("file2.js", 0); testable.SetupJSLintFile("file3.js", 3); var actual = testable.Instance.Execute(); I.Expect(actual).ToBeFalse(); } }
public void Spec09() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file1.js", 2); testable.SetupJSLintFile("file2.js", 1); testable.SetupJSLintFile("file3.js", 5); testable.SetupJSLintFile("file4.js", 2); testable.Instance.Execute(); I.Expect(testable.Instance.ErrorCount).ToBe(10); } }
public void Spec11() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file1.js", 3); testable.SetupJSLintFile("file2.js", 0); testable.SetupJSLintFile("file3.js", 0); testable.SetupJSLintFile("file4.js", 1); testable.Instance.Execute(); I.Expect(testable.Instance.ProcessedFileCount).ToBe(4); } }
public void Spec06() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file1.js", 0); testable.SetupJSLintFile("jsfile2.js", 0); testable.Instance.Execute(); testable.JSLintContextMock.Verify(x => x.Lint("file1.js contents", It.IsAny <JSLintOptions>())); testable.JSLintContextMock.Verify(x => x.Lint("jsfile2.js contents", It.IsAny <JSLintOptions>())); testable.JSLintContextMock.Verify(x => x.Lint(It.IsAny <string>(), It.IsAny <JSLintOptions>()), Times.Exactly(2)); } }
public void Spec07() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file1.js", 2); testable.SetupJSLintFile("jsfile2.js", 1); testable.Instance.Execute(); testable.LoggingHelperMock.Verify(x => x.LogError(It.IsAny <string>(), null, null, It.Is <string>(y => y.EndsWith("file1.js")), 1, 1, 0, 0, "JSLint : file1.js message 1")); testable.LoggingHelperMock.Verify(x => x.LogError(It.IsAny <string>(), null, null, It.Is <string>(y => y.EndsWith("file1.js")), 2, 2, 0, 0, "JSLint : file1.js message 2")); testable.LoggingHelperMock.Verify(x => x.LogError(It.IsAny <string>(), null, null, It.Is <string>(y => y.EndsWith("jsfile2.js")), 1, 1, 0, 0, "JSLint : jsfile2.js message 1")); testable.LoggingHelperMock.Verify(x => x.LogWarning(It.IsAny <string>(), null, null, It.IsAny <string>(), It.IsAny <int>(), It.IsAny <int>(), 0, 0, It.IsAny <string>()), Times.Never()); } }
public void Spec16() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file.js", JSLintNetSettings.DefaultErrorLimit); testable.Instance.Execute(); I.Expect(testable.BuildEngine.ErrorEvents).ToContain(x => x.Message == string.Format(Resources.ErrorLimitReachedFormat, JSLintNetSettings.DefaultErrorLimit)); } }
public void Spec13() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file.js", 0); testable.Instance.Execute(); testable.Verify <IJSLintFactory>(x => x.CreateReportBuilder()); } }
public void Spec02() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file.js", 0); var actual = testable.Instance.Execute(); I.Expect(actual).ToBeTrue(); } }
public void Spec18() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file.js", 0); testable.ProcessedFileCount = JSLintNetSettings.DefaultFileLimit; testable.Instance.Execute(); testable.LoggingHelperMock.Verify(x => x.LogError(Resources.FileLimitReachedFormat, JSLintNetSettings.DefaultFileLimit)); } }
public void Spec15() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file.js", 0); testable.Instance.ReportFile = "REPORTFILE"; testable.Instance.Execute(); testable.Verify <IFileSystemWrapper>(x => x.WriteAllText(@"D:\solution\source\project\REPORTFILE", It.IsAny <string>(), Encoding.UTF8)); } }
public void Spec05() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file.js", 2); testable.Settings.Output = Output.Warning; testable.SettingsExist = true; var actual = testable.Instance.Execute(); I.Expect(actual).ToBeTrue(); } }
public void Spec19() { using (var testable = new ExecuteTestable()) { testable.Settings.ErrorLimit = 10; testable.SettingsExist = true; testable.SetupJSLintFile("file.js", 11); testable.Instance.Execute(); testable.LoggingHelperMock.Verify(x => x.LogError(Resources.ErrorLimitReachedFormat, 11)); } }
public void Spec15() { using (var testable = new ExecuteTestable()) { testable.SetupJSLintFile("file.js", 0); testable.Instance.ReportFile = "REPORTFILE"; testable.Instance.Execute(); testable.JSLintReportBuilderMock.Verify(x => x.ToString()); testable.Verify <IFileSystemWrapper>(x => x.WriteAllText(@"D:\solution\source\project\REPORTFILE", "REPORTRESULT", Encoding.UTF8)); } }
public void Spec19() { using (var testable = new ExecuteTestable()) { testable.Settings.ErrorLimit = 10; testable.SettingsExist = true; testable.SetupJSLintFile("file.js", 11); testable.Instance.Execute(); I.Expect(testable.BuildEngine.ErrorEvents).ToContain(x => x.Message == string.Format(Resources.ErrorLimitReachedFormat, 11)); } }
public void Spec18() { using (var testable = new ExecuteTestable()) { for (int i = 0; i < JSLintNetSettings.DefaultFileLimit; i++) { testable.SetupJSLintFile("file" + i + ".js", 0); } testable.Instance.Execute(); I.Expect(testable.BuildEngine.ErrorEvents).ToContain(x => x.Message == string.Format(Resources.FileLimitReachedFormat, JSLintNetSettings.DefaultFileLimit)); } }
public void Spec20() { using (var testable = new ExecuteTestable()) { testable.Settings.FileLimit = 10; testable.SettingsExist = true; for (int i = 0; i < 10; i++) { testable.SetupJSLintFile("file" + i + ".js", 0); } testable.Instance.Execute(); I.Expect(testable.BuildEngine.ErrorEvents).ToContain(x => x.Message == string.Format(Resources.FileLimitReachedFormat, 10)); } }