Exemplo n.º 1
0
 public void ShowHaarViewer()
 {
     using (var viewer = new HaarViewer())
     {
         WinFormsApprovals.Verify(viewer);
     }
 }
        public void TestPieChartCompareWindow()
        {
            frmMain main = new frmMain();
            ChartSingleCompareOrig chart = main.LaunchChart(712, "splitdisplay", false);

            WinFormsApprovals.Verify(chart);
        }
        public void AddInstrument_FormResize()
        {
            using (var form = new MonkeyCancelFrm())
            {
                form.Show();

                form.InstrumentDefinitions = Helpers.CreateListOf4ProductDefs();
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZBU5"));
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZFU5"));
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZTU5"));
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZNU5"));
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZZU5"));
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZZU6"));
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZZU7"));
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZZU8"));
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZZU9"));
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZZUA"));
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZZUB"));

                form.Width  += 50;
                form.Height += 50;

                WinFormsApprovals.Verify(form);
            }
        }
Exemplo n.º 4
0
 public void TestControlApproved()
 {
     ApprovalResults.UniqueForMachineName();
     WinFormsApprovals.Verify(new Button {
         BackColor = Color.LightBlue, Text = "Help"
     });
 }
Exemplo n.º 5
0
        public void VerifyScenario()
        {
            var frm = new SeriesCalculator();

            frm.PopulateForm(10);
            WinFormsApprovals.Verify(frm);
        }
        public void TestBarChartWindow()
        {
            frmMain main = new frmMain();
            ChartSingleCompareOrig chart = main.LaunchChart(150, "rpfll", false);

            WinFormsApprovals.Verify(chart);
        }
Exemplo n.º 7
0
        public void GenerateOther()
        {
            var checkins = Enumerable.Range(0, 8 * 4 * 7)
                           .SelectMany(c => GenerateForDay(c));

            WinFormsApprovals.Verify(new CheckInChart(checkins));
        }
Exemplo n.º 8
0
 public void TestControlApproved()
 {
     WinFormsApprovals.Verify(new Button
     {
         BackColor = Color.LightBlue,
         Text      = "Help"
     });
 }
Exemplo n.º 9
0
        public void TestBarChartCompare()
        {
            frmMain main = new frmMain();
            ChartSingleCompareOrig chart = main.LaunchChart(406, "splitdisplay", false);

            chart.Show();
            WinFormsApprovals.Verify(chart);
        }
Exemplo n.º 10
0
        public void TestCheckins()
        {
            var checkins = new[] { new CheckIn(1, 9, 30, 10)
                                   , new CheckIn(1, 14, 30, 10)
                                   , new CheckIn(1, 19, 30, 100)
                                   , new CheckIn(2, 10, 0, 500) };

            WinFormsApprovals.Verify(new CheckInChart(checkins));
        }
Exemplo n.º 11
0
        public void GenerateHunter()
        {
            var    start    = new DateTime(2012, 12, 30);
            string csvFile  = @"C:\code\DashBoard\DashBoard\checkins.csv";
            var    checkins = ProcessCsvFile(csvFile)
                              .Select(p => new { FileCount = int.Parse(p[0]), Date = DateTime.Parse(p[1]) })
                              .Select(c => new CheckIn((c.Date - start).Days, c.Date.Hour, c.Date.Minute, c.FileCount));

            WinFormsApprovals.Verify(new CheckInChart(checkins));
        }
Exemplo n.º 12
0
        public void TestMeetings()
        {
            var meetings = WeekDays().Select(i => new Meeting(i, 8, 0, 10, 5)).Concat(new[]
            {
                new Meeting(1, 13, 0, 60, 3),
                new Meeting(5, 10, 30, 30, 20),
                new Meeting(8, 9, 0, 90, 10)
            });

            WinFormsApprovals.Verify(new MeetingsChart(meetings, 10));
        }
    public void TestFormApproval()
    {
        using (ApprovalResults.UniqueForDotNetVersion())
        {
            #region usage

            WinFormsApprovals.Verify(new Form());

            #endregion
        }
    }
Exemplo n.º 14
0
        public void HunterMeetings()
        {
            var meetings = Mondays()
                           .Select(i => new Meeting(i, 13, 15, 20, 2))
                           .Concat(new[] { new Meeting(4 * 7 - 3, 13, 0, 60, 5), new Meeting(8 * 7 - 3, 13, 0, 60, 5) });
            var chart = new MeetingsChart(meetings, 5);

            Console.WriteLine("Total Man Hours:{0}".FormatWith(chart.GetTotalManHours()));
            Console.WriteLine("Percent Of Week:{0}".FormatWith(chart.GetPercentOfWeek()));
            WinFormsApprovals.Verify(chart);
        }
Exemplo n.º 15
0
        public void HeapfulOfRectangles()
        {
            var myForm = new MyForm();

            WinFormsApprovals.Verify(myForm);

            //            Point start = null;
            //            Point end = null;

            //            throw new ArgumentException(@"Rectangle ‘{{X={0},Y={1},Width={2},Height={3}}}'
            //cannot have a width or height equal to 0.", start.X, start.Y, end.X - start.X, end.Y - start.Y);
        }
 public void TestControlApproved()
 {
     using (ApprovalResults.UniqueForDotNetVersion())
     {
         WinFormsApprovals.Verify(
             new Button
         {
             BackColor = Color.LightBlue,
             Text      = "Help"
         });
     }
 }
Exemplo n.º 17
0
        public void TestAddingIceCream()
        {
            var form     = new AddIceCreamForm();
            var iceCream = new IceCreamProduct
            {
                Name   = "Fatty Cake",
                Cost   = "2.50",
                Flavor = "Big Haus"
            };

            form.AddIceCreamToFreezer(iceCream);
            WinFormsApprovals.Verify(form);
        }
        public void AddInstrument_TheLastArrivedFirst()
        {
            using (var form = new MonkeyCancelFrm())
            {
                form.Show();

                form.InstrumentDefinitions = Helpers.CreateListOf4ProductDefs();
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZTU5"));
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZNU5"));
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZBU5"));
                form.AddInstrument(Helpers.CreateInstrumentByAlias("ZFU5"));

                WinFormsApprovals.Verify(form.Controls["flowLayoutPanelInstruments"]);
            }
        }
Exemplo n.º 19
0
        public void Should_work_with_this_complex_object()
        {
            var treeView = GetTreeView(@"{
	'id': '0001',
	'type': 'donut',
	'batters':
	{
		'batter':
		[
			{ 'id': '1001', 'type': 'Regular' },
			{ 'id': '1002', 'type': 'Chocolate' },
		]
	},
	'topping':
	[
		{ 'id': '5001', 'type': 'None' },
		{ 'id': '5002', 'type': 'Glazed', 'tags': [ 'foo', 'bar' ] }
	],
	'name': 'Cake',
	'ppu': 0.55,
}");

            WinFormsApprovals.Verify(treeView);
        }
Exemplo n.º 20
0
        public void Should_work_with_objects_in_arrays()
        {
            var treeView = GetTreeView("{ 'foo': [ 'bar', { 'sheldon': 'cooper', 'leonard': 'hofstadter' }, 'quux' ] }");

            WinFormsApprovals.Verify(treeView);
        }
Exemplo n.º 21
0
 public void TestFormApproval()
 {
     ApprovalResults.UniqueForMachineName();
     WinFormsApprovals.Verify(new Form());
 }
        public void TestMainWindow()
        {
            frmMain main = new frmMain();

            WinFormsApprovals.Verify(main);
        }
Exemplo n.º 23
0
        public void Should_work_with_nested_objects()
        {
            var treeView = GetTreeView("{ 'the_answer': { 'to_the': { 'universe_is': 42 } } }");

            WinFormsApprovals.Verify(treeView);
        }
Exemplo n.º 24
0
 public void TestFormApproval()
 {
     WinFormsApprovals.Verify(new Form());
 }
Exemplo n.º 25
0
        public void Should_work_with_nested_arrays()
        {
            var treeView = GetTreeView("{ 'foo': [ 'bar', [ 'sheldon', 'cooper', 'leonard', 'hofstadter' ], 'quux' ] }");

            WinFormsApprovals.Verify(treeView);
        }
Exemplo n.º 26
0
        public void TestHunterBugChart()
        {
            var bugs = Enumerable.Range(0, 60).SelectMany(i => GenerateHunterBugs(i));

            WinFormsApprovals.Verify(new BugsChart(bugs));
        }
Exemplo n.º 27
0
 public void TestEmptyBugChart()
 {
     WinFormsApprovals.Verify(new BugsChart(new Bug[0]));
 }
Exemplo n.º 28
0
        public void Should_work_with_arrays()
        {
            var treeView = GetTreeView("{ 'foo': [ 'bar', 'baz', 'quux' ] }");

            WinFormsApprovals.Verify(treeView);
        }
Exemplo n.º 29
0
 public void TestEmptyMeetings()
 {
     WinFormsApprovals.Verify(new MeetingsChart(new Meeting[0], 10));
 }
Exemplo n.º 30
0
 public void TestEmptyCheckins()
 {
     WinFormsApprovals.Verify(new CheckInChart(new CheckIn[0]));
 }