Example #1
0
        public void OrderNumsNotInRangeGenerateMissingIntervalObject()
        {
            //Arrange
            var orderNums = new[] { 1, 2, 3, 4, 5 };

            var sut = new OrderDiffGenerator();

            //Act
            var orderReport = sut.InclusionReport(orderNums, 6, 10);

            //Assert
            Assert.AreEqual(5, orderReport.MissingInInterval.Count());
        }
Example #2
0
        public void OrderNumsAboveRangeGenerateAboveIntervalObject()
        {
            //Arrange
            var orderNums = new[] { 11, 12, 13, 14, 15 };

            var sut = new OrderDiffGenerator();

            //Act
            var orderReport = sut.InclusionReport(orderNums, 6, 10);

            //Assert
            Assert.AreEqual(5, orderReport.AboveUpperBound.Count());
        }
Example #3
0
        public void OrderNumsBelowRangeGenerareBelowRangeObject()
        {
            //Arrange
            var orderNums = new[] { 1, 2, 3, 4, 5 };

            var sut = new OrderDiffGenerator();

            //Act
            var orderReport = sut.InclusionReport(orderNums, 6, 10);

            //Assert
            Assert.AreEqual(5, orderReport.BelowLowerBound.Count());
        }
Example #4
0
        public void WhenAllOrderNumbersAreBelowAndAboveIntervalTwoObjectsAreGenerated()
        {
            //Arrange
            var orderNums = new[] { 1, 2, 3, 11, 12, 13 };

            var sut = new OrderDiffGenerator();

            //Act
            var orderReport = sut.InclusionReport(orderNums, 6, 10);

            //Assert
            Assert.AreEqual(3, orderReport.BelowLowerBound.Count());
            Assert.AreEqual(3, orderReport.AboveUpperBound.Count());
        }
Example #5
0
        public void WhenAllOrderNumbersAreInIntervalNoObjectIsGenerated()
        {
            //Arrange
            var orderNums = new[] { 6, 7, 8, 9, 10 };

            var sut = new OrderDiffGenerator();

            //Act
            var orderReport = sut.InclusionReport(orderNums, 6, 10);

            //Assert
            Assert.IsFalse(orderReport.BelowLowerBound.Any());
            Assert.IsFalse(orderReport.MissingInInterval.Any());
            Assert.IsFalse(orderReport.AboveUpperBound.Any());
        }