Exemplo n.º 1
0
        public void FindAvailableTest3()
        {
            Range limiting = new Range(0, 100);

            Range[] dataPoint = new Range[]
            {
                new Range(0, 20)
            };

            Range[] result = Availability.FindAvailable(limiting, dataPoint);

            Assert.IsTrue(result.Length == 1, "The length is not 1");

            Assert.IsTrue(result[0].Start == 21 && result[0].End == 100);
        }
Exemplo n.º 2
0
        public void FindAvailableTest4()
        {
            Range limiting = new Range(0, 100);

            Range[] dataPoint = new Range[]
            {
                new Range(10, 20)
            };

            Range[] result = Availability.FindAvailable(limiting, dataPoint);

            Assert.IsTrue(result.Length == 2, "The length is not 2");

            Range firstRange = result[0];

            Assert.IsTrue(firstRange.Start == 0 && firstRange.End == 9, "First result error");

            Range secondRange = result[1];

            Assert.IsTrue(secondRange.Start == 21 && secondRange.End == 100, "Second result error");
        }
Exemplo n.º 3
0
        public void FindAvailableTest2()
        {
            Range limiting = new Range(0, 100);

            IList <Range> dataPoint = new List <Range>();

            dataPoint.Add(new Range(50, 97));
            dataPoint.Add(new Range(80, 97));
            dataPoint.Add(new Range(0, 30));

            Range[] result = Availability.FindAvailable(limiting, dataPoint.ToArray());

            Assert.IsTrue(result.Length == 2, "The result length is not 2");

            Range firstRange = result[0];

            Assert.IsTrue(firstRange.Start == 31 && firstRange.End == 79);

            Range secondRange = result[1];

            Assert.IsTrue(secondRange.Start == 98 && secondRange.End == 100);
        }