public void EnumerableDoesNotMatchApproval() { Approvals.Approve(new[] { "Does not match" }, "collection"); }
public void EnumerableNotApprovedYet() { Approvals.Approve(new[] { "Not approved" }, "collection"); }
public virtual void ApproveRssFeedItemExplicitCountParse() { var feed = Factory.CreateFeed(feeduri); var strFeedItems = from feeditem in feed.Items.Take(itemCount) select feeditem.ToApprovalString(); Approvals.Approve(strFeedItems, "feed items"); }
public virtual void ApproveAtomFeedItemParse() { IFeed feed = Factory.CreateFeed(feeduri); var strFeedItems = from feeditem in feed.Items select feeditem.ToApprovalString(); Approvals.Approve(strFeedItems, "feed items"); }
public void Approve(string path, string testName, byte[] content) { IApprovalNamer namer = new SimpleNamer(path, testName); IApprovalWriter writer = new BinaryWriter(content, "png"); IApprovalFailureReporter reporter = new ImageReporter(); Approvals.Approve(writer, namer, reporter); }
public virtual void ApproveRssFeedItemContent() { var feed = Factory.CreateFeed(feeduri); var strFeedItems = from feeditem in feed.Items select feeditem.ToApprovalString(); Approvals.Approve(strFeedItems, "feed items"); }
public void TestExistFileIsApproved() { var basePath = Environment.CurrentDirectory + @"\..\..\"; var original = basePath + "a.png"; var copy = basePath + "a1.png"; File.Copy(original, copy); Approvals.Approve(new ExistingFileWriter(copy), Approvals.GetDefaultNamer(), Approvals.GetReporter()); }
public void WatchForResultsShouldConfigureWatcher() { var serviceSentry = Monitor.Interactions(typeof(Service)); Service service = new Service(); service.WatchForResults("", () => { }); Approvals.Approve(serviceSentry.Report); }
public void TestReporter() { try { Approvals.Approve("Hello"); } catch (AssertionException e) { Assert.AreEqual(" String lengths are both 5. Strings differ at index 0.\r\n Expected: \"World\"\r\n But was: \"Hello\"\r\n -----------^\r\n", e.Message); } }
public void StartTheExplorerWhenInitializingThePlugin() { Sentry pluginSentry = Monitor.Interactions(typeof(PlugIn)); Isolate.WhenCalled(() => VisualStudio.Solution).WillReturn(""); Isolate.WhenCalled(() => VisualStudio.HasASolutionOpened).WillReturn(true); Isolate.WhenCalled(() => VisualStudio.HasAnActiveTextView).WillReturn(true); PlugIn plugin = new PlugIn(); Approvals.Approve(pluginSentry.Report); }
public void TestReporter() { try { Approvals.Approve("Hello"); } catch (AssertFailedException e) { Assert.AreEqual("Assert.AreEqual failed. Expected:<World>. Actual:<Hello>. ", e.Message); } }
public void HideOverlayWhenTextHasChanged() { Sentry pluginSentry = Monitor.Interactions(typeof(PlugIn)); Isolate.WhenCalled(() => VisualStudio.HasASolutionOpened).WillReturn(false); PlugIn plugin = new PlugIn(); plugin.WhenTextChanges(null); Approvals.Approve(pluginSentry.Report); }
public void DisplayOverlayOnShow() { overlay.Show(new List <CoverageResult> { new CoverageResult { VisitCount = 0 }, new CoverageResult { VisitCount = 1 } }); Approvals.Approve(visualStudioSentry.Report); }
public void TestTimes() { var log = Logger.LogToStringBuilder(); Logger.UseTimer(new MockTimer()); Logger.Show(timestamp: true, timeDifference: true); Logger.Variable("name", "Llewellyn"); Logger.Variable("name", "Llewellyn"); Logger.Variable("name", "Llewellyn"); Approvals.Approve(log.ToString()); }
static void Main(string[] args) { var v = "valuie"; var x = "xalue;"; Console.WriteLine("Starting"); Approvals.DefaultNamerSource = (() => new OldUnitNamer(v, x)); Approvals.DefaultReporterSource = (() => new ApprovalTests.Reporters.DiffReporter()); x = @"c:\testnamer"; Approvals.Approve("TEST"); Console.ReadLine(); }
public void CacheResults() { var serviceSentry = Monitor.Interactions(typeof(Service)); Isolate.WhenCalled(() => VisualStudio.ActiveFilePath).WillReturn("foo.cs"); Service service = new Service(); service.GetCoverageResultsForActiveDocument(); service.GetCoverageResultsForActiveDocument(); Approvals.Approve(serviceSentry.Report); }
public void UpdateOverlayWhenPaintingBackground() { Sentry pluginSentry = Monitor.Interactions(typeof(PlugIn)); Isolate.WhenCalled(() => VisualStudio.Solution).WillReturn(""); Isolate.WhenCalled(() => VisualStudio.HasASolutionOpened).WillReturn(true); Isolate.WhenCalled(() => VisualStudio.HasAnActiveTextView).WillReturn(true); PlugIn plugin = new PlugIn(); plugin.WhenPaintingBackground(null); Approvals.Approve(pluginSentry.Report); }
public void TestMethod1() { var control = new TestSilverlightControl(); TestHelper.WaitFor(this, control, "Loaded"); TestPanel.Children.Add(control); EnqueueCallback(() => Approvals.Approve( @"D:\Projects\ApprovalTests\ApprovalTests.Silverlight.Tests", "Tests.TestMethod1", control)); EnqueueTestComplete(); }
public void StartTheServiceWhenASolutionIsOpen() { Sentry pluginSentry = Monitor.Interactions(typeof(PlugIn)); Isolate.WhenCalled(() => VisualStudio.HasASolutionOpened).WillReturn(false); Isolate.WhenCalled(() => VisualStudio.HasAnActiveTextView).WillReturn(true); Isolate.WhenCalled(() => VisualStudio.Solution).WillReturn(""); PlugIn plugin = new PlugIn(); plugin.AfterOpeningSolution(); Approvals.Approve(pluginSentry.Report); }
private static void AssertLauncher(string approved, string received, DiffReporter reporter) { var args = reporter.GetLaunchArguments(approved, received); try { Approvals.Approve(args.ToString()); } catch { reporter.Launch(args); throw; } }
public void TestDataSourceNames() { var message = ""; try { RdlcReports.Approvals.ApproveReport(ReportName, GetAssembly(), "purposelyMisspelt", GetDefaultData()); } catch (Exception e) { message = e.Message; } Approvals.Approve(message); }
public void TestMainPath() { var log = Logger.LogToStringBuilder(); Logger.MarkerIn(); Logger.Event("Starting"); var name = "Llewellyn"; Logger.Variable("name", name); Logger.Message("I Got here"); Logger.Sql("Select * From table_name"); try { throw new Exception(" Problem"); } catch (Exception e) { Logger.Warning(e); } Logger.MarkerOut(); Approvals.Approve(log.ScrubPath(PathUtilities.GetDirectoryForCaller())); }
public void TextNotApprovedYet() { Approvals.Approve("should fail with a missing exception"); }
public void TextDoesNotMatchApproval() { Approvals.Approve("should fail with mismatch"); }
public void MSTestVS2010() { Approvals.Approve("2010"); }
public void TestInsultLoader() { string conn = @"server=.\sqlexpress;database=Insults;trusted_connection=true"; Approvals.Approve(new InsultLoaderShortAndSweet(7, 5, conn)); }
public void ParseNCover3() { Approvals.Approve(ResultParser.Parse("NCover-3.xml", @"c:\foo-3.cs"), CoverageResultsFormatter); }
public void Text() { Approvals.Approve(new CompanyLoaderByName("M")); }
public void MissingResultFile() { Approvals.Approve(ResultParser.Parse("Missing.xml", @"c:\foo.cs"), CoverageResultsFormatter); }
public void TestWeather() { Approvals.Approve(new WeatherLoader("KCASANDI69")); }