コード例 #1
0
ファイル: ElapsedTimeTest.cs プロジェクト: ChrisBDFA/fitsharp
 [Test] public void LongTimeIsShown() {
     Clock.Instance = TestClock.Instance;
     TestClock.Instance.UtcNow = new DateTime(2009, 1, 2, 3, 4, 5, 6);
     var elapsed = new ElapsedTime();
     TestClock.Instance.UtcNow = new DateTime(2010, 1, 2, 6, 4, 5, 7);
     Assert.AreEqual("8763:00:00.001", elapsed.ToString());
 }
コード例 #2
0
ファイル: StoryTestFolder.cs プロジェクト: GibSral/fitsharp
 public void ListFile(string thePath, TestCounts counts, ElapsedTime elapsedTime) {
     myReport.WriteLine("<br /><a href=\"{0}\">{0}</a> <span class=\"{2}\">{1}</span> in {3}",
                        thePath.Substring(myReportPath.Length + 1).Replace('\\', '/'),
                        counts.Description,
                        counts.Style,
                        elapsedTime);
 }
コード例 #3
0
ファイル: StoryTestFolder.cs プロジェクト: GibSral/fitsharp
 public void ListFile(string theFileName, TestCounts counts, ElapsedTime elapsedTime) {
     if (myReport != null) {
         myReport.ListFile(theFileName, counts, elapsedTime);
     }
     else {
         myParent.ListFile(theFileName, counts, elapsedTime);
     }
 }
コード例 #4
0
ファイル: StoryTestFile.cs プロジェクト: marisaseal/fitsharp
 private void WriteResult(StoryTestString testResult, TestCounts counts, ElapsedTime elapsedTime)
 {
     string outputFile = OutputPath;
     var output = new StringWriter();
     output.Write(testResult);
     output.Close();
     myFolderModel.MakeFile(outputFile, output.ToString());
     myFolder.ListFile(outputFile, counts, elapsedTime);
 }
コード例 #5
0
ファイル: StoryTestFile.cs プロジェクト: marisaseal/fitsharp
 public void ExecuteStoryPage(Action<StoryPageName, StoryTestString, Action<StoryTestString, TestCounts>, Action> executor, ResultWriter resultWriter, Action<TestCounts> handler)
 {
     elapsedTime = new ElapsedTime();
     this.resultWriter = resultWriter;
     this.handler = handler;
     if (HasTestName) {
         executor(myPath, DecoratedContent, WriteFile, HandleNoTest);
         return;
     }
     if (myPath.IsSuiteSetUp || myPath.IsSuiteTearDown) {
         executor(myPath, PlainContent, WriteFile, HandleNoTest);
         return;
     }
     HandleNoTest();
 }
コード例 #6
0
ファイル: SuiteRunner.cs プロジェクト: GibSral/fitsharp
            public void Do(StoryTestPage page) {
                var elapsedTime = new ElapsedTime();
                var input = page.TestContent;
                if (string.IsNullOrEmpty(input)) {
                    page.WriteNonTest();
                    DoNoTest();
                }

                StoreCurrentlyExecutingPagePath(page.Name.Name);

	            var service = new Service.Service(memory);
                var writer = new StoryTestStringWriter(service);
                var storyTest = new StoryTest(service, writer).WithInput(input);

                if (!storyTest.IsExecutable) {
                    page.WriteNonTest();
                    DoNoTest();
	                return;
	            }

                storyTest.OnAbandonSuite(() => { SuiteIsAbandoned = true; });

                if (page.Name.IsSuitePage) {
                    storyTest.Execute();
                }
                else {
                    storyTest.Execute(new Service.Service(service));
                }

                var pageResult = new PageResult(page.Name.Name, writer.Tables, writer.Counts, elapsedTime);
                page.WriteTest(pageResult);
                handleCounts(writer.Counts);
                resultWriter.WritePageResult(pageResult);
            }
コード例 #7
0
ファイル: SuiteRunner.cs プロジェクト: skolima/fitsharp
 public void Do(StoryTestPage page)
 {
     var elapsedTime = new ElapsedTime();
     var input = page.TestContent;
     if (string.IsNullOrEmpty(input)) {
         page.WriteNonTest();
         DoNoTest();
     }
     var service = new Service.Service(configuration);
     Tree<Cell> result = service.Compose(new StoryTestString(input));
     if (result == null || result.Branches.Count == 0) {
         page.WriteNonTest();
         DoNoTest();
         return;
     }
     var writer = new StoryTestStringWriter(service);
     var storyTest = new StoryTest((Parse) result, writer);
     if (page.Name.IsSuitePage) {
         storyTest.ExecuteOnConfiguration(configuration);
     }
     else {
         storyTest.Execute(configuration);
     }
     var pageResult = new PageResult(page.Name.Name, writer.Tables, writer.Counts, elapsedTime);
     page.WriteTest(pageResult);
     handleCounts(writer.Counts);
     resultWriter.WritePageResult(pageResult);
 }
コード例 #8
0
ファイル: PageResult.cs プロジェクト: GibSral/fitsharp
 public PageResult(string title, string content, TestCounts testCounts, ElapsedTime elapsedTime) {
     Title = title;
     Content = content;
     TestCounts = testCounts;
     ElapsedTime = elapsedTime;
 }