Exemple #1
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            try
            {
                var seatPassesFilter = true;

                if (!String.IsNullOrWhiteSpace(Position))
                {
                    var pos = new StadiumPosition(Seat.SectionName, Seat.RowName, Seat.SeatName);
                    if (!pos.IsMatch(Position))
                    {
                        seatPassesFilter = false;
                    }
                }

                if (_codeValues != null)
                {
                    if (!_codeValues.Any(cv => cv == Seat.EttCode.CodeValue))
                    {
                        seatPassesFilter = false;
                    }
                }

                if (seatPassesFilter)
                {
                    WriteObject(Seat);
                }
            }
            catch (Exception)
            {
            }
        }
Exemple #2
0
        public void IsMatch_WhenGivenWrongRow_ReturnsFalse()
        {
            // Arrange
            var filter = "BA:12:1";
            var sut    = new StadiumPosition("BA", "12", "34");

            // Act
            var res = sut.IsMatch(filter);

            // Assert
            res.Should().BeFalse("the row is different");
        }
Exemple #3
0
        public void IsMatch_WhenGivenExactMatch_ReturnsTrue()
        {
            // Arrange
            var filter = "BA:12:34";
            var sut    = new StadiumPosition("BA", "12", "34");

            // Act
            var res = sut.IsMatch(filter);

            // Assert
            res.Should().BeTrue("this is an exact match");
        }
Exemple #4
0
        public void IsMatch_WhenGivenOnlySeatThatDoesNotMatch_ReturnsFalse()
        {
            // Arrange
            var filter = "::35";
            var sut    = new StadiumPosition("BA", "12", "34");

            // Act
            var res = sut.IsMatch(filter);

            // Assert
            res.Should().BeFalse("we only care about the seat - which is wrong");
        }
Exemple #5
0
        public void IsMatch_WhenGivenOnlySeatThatMatches_ReturnsTrue()
        {
            // Arrange
            var filter = "::34";
            var sut    = new StadiumPosition("BA", "12", "34");

            // Act
            var res = sut.IsMatch(filter);

            // Assert
            res.Should().BeTrue("we only care about the seat - which is correct");
        }
Exemple #6
0
 public void Export(IList <BillettServiceSete> seter, string input)
 {
     Console.WriteLine("Rapporterer status på seter som matcher {0}", input);
     foreach (var seat in seter)
     {
         var pos = new StadiumPosition(seat.SectionName, seat.RowName, seat.SeatName);
         if (pos.IsMatch(input))
         {
             Console.WriteLine("{0} {1} ({2})", pos.ToString().PadRight(15), seat.EttCode.Code, SeatStatusClassifier.Classify(seat.EttCode.Code));
         }
     }
 }