Пример #1
0
        public void Render(BillettServiceEvent bsEvent, int width = 460, int height = 650)
        {
            var ctrl = new SingleMatch {
                DataContext = _vm = new SingleMatchViewmodel(bsEvent)
            };

            var path = Path.Combine(StautConfiguration.Current.StaticImageDirectory, bsEvent.EventNumber + ".png");

            RenderAndSave(ctrl, path, width, height);
        }
        public void CreateTournamentName_WhenGivenTippeligaenEvent_ReturnsExpectedName()
        {
            // Arrange
            var evt = CreateTournament();

            evt.Start = new DateTime(2016, 4, 2, 20, 00, 00);
            var sut = new SingleMatchViewmodel(evt);

            // Act
            var res = sut.CreateTournamentName(evt);

            // Assert
            res.Should().Be("Tippeligaen 2016", "that is the correct league name for this date");
        }
        public void CreateTournamentName_WhenGivenEuropeanCupEvent_ReturnsExpectedName()
        {
            // Arrange
            var evt = CreateTournament();

            evt.Start      = new DateTime(2016, 4, 2, 20, 00, 00);
            evt.Tournament = "EC";
            var sut = new SingleMatchViewmodel(evt);

            // Act
            var res = sut.CreateTournamentName(evt);

            // Assert
            res.Should().Be("Europacup", "that is the correct tournament name for this date");
        }
Пример #4
0
        public void Render(BillettServiceEvent bsEvent, int width = 460, int height = 650)
        {
            var ctrl = new SingleMatch {
                DataContext = _vm = new SingleMatchViewmodel(bsEvent)
            };

            var path = Path.Combine(StautConfiguration.Current.StaticImageDirectory, bsEvent.EventNumber + ".png");

            Trace.TraceInformation("Rendering {0}x{1} chart for event {2} to {3}", width, height, bsEvent.EventNumber, path);

            var sw = new Stopwatch();

            sw.Start();

            RenderAndSave(ctrl, path, width, height);

            sw.Stop();
            Trace.TraceInformation("Chart render took {0}ms", sw.ElapsedMilliseconds);
        }