예제 #1
0
        public void WaterWSIsNotModified()
        {
            IWaterState waterState = new SolidWS();
            Water       water      = new Water(waterState);
            IWaterState result;

            result = water.WaterState;

            Assert.AreEqual(waterState, result);
        }
예제 #2
0
        public void SolidWSFrostAreEqual()
        {
            string      constResult = "Продолжаем заморозку льда";
            IWaterState waterState  = new SolidWS();
            Water       water       = new Water(waterState);
            string      result;

            result = waterState.Frost(water);

            Assert.AreEqual(constResult, result);
        }
예제 #3
0
        public void SolidWSHeatAreEqual()
        {
            string      constResult = "Превращаем лёд в жидкость";
            IWaterState waterState  = new SolidWS();
            Water       water       = new Water(waterState);
            string      result;

            result = waterState.Heat(water);

            Assert.AreEqual(constResult, result);
        }