Example #1
0
        public void Should_Calculate_Time_Spent_On_ParkingSpace()
        {
            var parkingSpace = new ParkingSpace(ParkingSpaceType.Car);

            parkingSpace.Occupy(2);
            Thread.Sleep(2000); //2seg
            parkingSpace.Release();

            var expected = (double)2000 / 60000; //ms to min

            Assert.Equal(expected.ToString("0.##"),
                         parkingSpace.CalculateTimeSpent().ToString("0.##"));
        }