Пример #1
0
        void FillBackSideTextByDrawText(Graphics gr)
        {
            const int textMainMargin = 468;
            const int textMargin     = textMainMargin + 41;
            const int textWidth      = 450;

            GraphicsHelper.DrawText(gr, "9.", textMainMargin, 38);
            GraphicsHelper.DrawText(gr, YearOfManufacture.ToUpper(), textMargin, 38, textWidth);
            GraphicsHelper.DrawText(gr, "10.", textMainMargin, 88);
            GraphicsHelper.DrawText(gr, Type.ToUpper(), textMargin, 88, textWidth);
            GraphicsHelper.DrawText(gr, "11.", textMainMargin, 138);
            GraphicsHelper.DrawText(gr, VehicleIdentificationNumber.ToUpper(), textMargin, 138, textWidth);
            GraphicsHelper.DrawText(gr, "12.", textMainMargin, 190);
            GraphicsHelper.DrawText(gr, GrossWeight.ToString("n2"), textMargin, 190, textWidth);
            GraphicsHelper.DrawText(gr, "13.", textMainMargin, 242);
            GraphicsHelper.DrawText(gr, CurbWeight.ToString("n2"), textMargin, 242, textWidth);
            GraphicsHelper.DrawText(gr, "14.", textMainMargin, 293);
            GraphicsHelper.DrawText(gr, EngineNumber.ToUpper(), textMargin, 293, textWidth);
            GraphicsHelper.DrawText(gr, "15.", textMainMargin, 345);
            GraphicsHelper.DrawText(gr, EnginePower.ToUpper(), textMargin, 345, textWidth);
            GraphicsHelper.DrawText(gr, "16.", textMainMargin, 395);
            GraphicsHelper.DrawText(gr, FuelType.ToUpper(), textMargin, 395, textWidth);
            GraphicsHelper.DrawText(gr, "17.", textMainMargin, 448);
            GraphicsHelper.DrawText(gr, NumberOfSeats.ToSafeString(), textMargin, 448, textWidth);
            GraphicsHelper.DrawText(gr, "18.", textMainMargin, 499);
            GraphicsHelper.DrawText(gr, NumberOfStandees.ToSafeString(), textMargin, 499, textWidth);
            GraphicsHelper.DrawText(gr, "19.", textMainMargin, 549);
            GraphicsHelper.DrawText(gr, SpecialMarks.ToUpper(), textMargin, 549, textWidth);
        }
Пример #2
0
        public void EqualNumberOfSeats()
        {
            var a = new NumberOfSeats(10);
            var b = new NumberOfSeats(10);

            Assert.Equal(a, b);
            Assert.True(a == b);
        }
 public override string ToString()
 {
     if (NumberOfSeats > 0)
     {
         return(Name + " (" + NumberOfSeats.ToString() + ")");
     }
     return(Name);
 }
Пример #4
0
        public void Test_Location()
        {
            var numberOfSeats = 4;
            var number1       = NumberOfSeats.From(numberOfSeats);
            var number2       = NumberOfSeats.From(numberOfSeats);

            Assert.Equal(number1, number2);
            Assert.True(number1 == number2);
        }
Пример #5
0
        public async Task <MeetupAggregate> Get(Guid meetupId)
        {
            var doc = await _collection.Find <MeetupMongoDocument>(doc => doc.Id == meetupId).FirstOrDefaultAsync();

            if (doc == null)
            {
                return(null);
            }

            return(new MeetupAggregate(
                       MeetupId.From(doc.Id),
                       new MeetupTitle(doc.Title),
                       Location.From(doc.Location),
                       NumberOfSeats.From(doc.NumberOfSeats),
                       doc.State.ToLower() switch
            {
                "published" => MeetupState.Published,
                "canceled" => MeetupState.Canceled,
                "created" => MeetupState.Created,
                _ => MeetupState.Created
            },
Пример #6
0
        public void Given_ValidNumberOfSeats_When_Create_Then_Throws(int numberOfSeats)
        {
            var seats = NumberOfSeats.From(numberOfSeats);

            Assert.Equal(numberOfSeats, seats);
        }
Пример #7
0
        public void Given_InvalidNumberOfSeats_When_Create_Then_Throws(int numberOfSeats)
        {
            Action meetup = () => NumberOfSeats.From(numberOfSeats);

            Assert.Throws <ArgumentException>(meetup);
        }