Beispiel #1
0
		public void NegligibleTimeComparerTest()
		{
			var room1 = new RoomAvailabilityInfo(_availableVerySoon, new RoomInfo
			{
				Location = new Location
				{
					Geometry = new Geometry(1, 1, 0)
				}
			});
			var room2 = new RoomAvailabilityInfo(_availableNow, new RoomInfo
			{
				Location = new Location
				{
					Geometry = new Geometry(2, 2, 0)
				}
			});
			var comparer = new SmartRoomComparer(_center);
			Assert.That(comparer.Compare(room1, room2), Is.LessThan(0));
			Assert.That(comparer.Compare(room2, room1), Is.GreaterThan(0));

			Assert.That(new SmartSearch(_center).Sort(new[] { room1, room2 }), Is.EqualTo(new[] { room1, room2 }));
		}
Beispiel #2
0
        public void NonNegligibleTimeComparerTest()
        {
            var room1 = new RoomAvailabilityInfo(_availableLater, new RoomInfo
            {
                Location = new Location
                {
                    Geometry = new Geometry(1, 1, 0)
                }
            });
            var room2 = new RoomAvailabilityInfo(_availableNow, new RoomInfo
            {
                Location = new Location
                {
                    Geometry = new Geometry(2, 2, 0)
                }
            });
            var comparer = new SmartRoomComparer(_center);

            Assert.That(comparer.Compare(room1, room2), Is.GreaterThan(0));
            Assert.That(comparer.Compare(room2, room1), Is.LessThan(0));

            Assert.That(new SmartSearch(_center).Sort(new[] { room1, room2 }), Is.EqualTo(new[] { room2, room1 }));
        }