Exemplo n.º 1
0
        public void CanGetHomeChangeDates()
        {
            HomeState stateHolder = new HomeState();
            DateTime date = new DateTime(2015, 01, 01);
            const string roomName = "bedroom";
            const string furnitureName = "sofa";
            stateHolder.CreateFurniture(furnitureName, roomName, date);

            var dates = stateHolder.GetHomeChangeDates();
            Assert.IsNotNull(dates);
            Assert.AreEqual(1, dates.Count);
            Assert.AreEqual(date, dates.First());

            DateTime anotherDate = new DateTime(2015, 01, 02);
            stateHolder.CreateFurniture(furnitureName, roomName, anotherDate);
            dates = stateHolder.GetHomeChangeDates();
            Assert.IsNotNull(dates);
            Assert.AreEqual(2, dates.Count);
            Assert.IsTrue(dates.Contains(date));
            Assert.IsTrue(dates.Contains(anotherDate));
        }