コード例 #1
0
        public void TestThatSetLocationReturnsLocation()
        {
            CO2Sensor sensor = new CO2Sensor();

            sensor.SetLocation("Main Door");
            Assert.AreEqual("Main Door", sensor.GetLocation());
            sensor.SetLocation("I have changed...change is inevitable");
            Assert.AreNotEqual("Main Door", sensor.GetLocation());
            Assert.AreEqual("I have changed...change is inevitable", sensor.GetLocation());
        }
コード例 #2
0
        public void TestThatGetLocationReturnsNull()
        {
            CO2Sensor sensor   = new CO2Sensor();
            string    location = sensor.GetLocation();

            Assert.AreEqual(string.Empty, location);
        }
コード例 #3
0
        public void TestThatGetLocationReturnsLocation()
        {
            CO2Sensor sensor   = new CO2Sensor("Entry");
            string    location = sensor.GetLocation();

            Assert.AreEqual("Entry", location);
            CO2Sensor sensor_2   = new CO2Sensor("Kitchen");
            string    location_2 = sensor_2.GetLocation();

            Assert.AreEqual("Kitchen", location_2);
        }