UpdateFromString() public method

public UpdateFromString ( string updateString ) : void
updateString string
return void
        public void UpdateFromString_InvalidUpdateString_ThrowException()
        {
            //This also tests the IsMatch method
            Motor m = new Motor(Motor.Location.MiddleRight);
            string updateString;

            updateString = "<M;M,R,23.12,45.0>";
            Assert.Throws<InvalidUpdateStringException>(() => m.UpdateFromString(updateString));
            updateString = "<MR;C,R,23.12,45.0>";
            Assert.Throws<InvalidUpdateStringException>(() => m.UpdateFromString(updateString));
            updateString = "MR;M,R,23.12,45.0";
            Assert.Throws<InvalidUpdateStringException>(() => m.UpdateFromString(updateString));
            updateString = "<MR;M,R,23.124453,45.0>";
            Assert.Throws<InvalidUpdateStringException>(() => m.UpdateFromString(updateString));
            updateString = "<MR;M,R,23.12,45.0145>";
            Assert.Throws<InvalidUpdateStringException>(() => m.UpdateFromString(updateString));
            updateString = "<MR;M,R,23.12,45.>";
            Assert.Throws<InvalidUpdateStringException>(() => m.UpdateFromString(updateString));
            updateString = "<MR;M,B,23.12,45.0>";
            Assert.Throws<InvalidUpdateStringException>(() => m.UpdateFromString(updateString));
            updateString = "<MR;M,R23.12,45.0>";
            Assert.Throws<InvalidUpdateStringException>(() => m.UpdateFromString(updateString));
            updateString = "<MRM,R,23.12,45.0>";
            Assert.Throws<InvalidUpdateStringException>(() => m.UpdateFromString(updateString));
            updateString = "<MR;F,R,23.12,45.0>";
            Assert.Throws<InvalidUpdateStringException>(() => m.UpdateFromString(updateString));
        }
        public void UpdateFromString_ValidUpdateString_ObjectUpdated()
        {
            Motor m = new Motor(Motor.Location.MiddleRight) { Current = 23.0f, Temperature = 50.0f };
            string updateString;

            updateString = "<MR;M,R,23.12,45.0>";
            m.UpdateFromString(updateString);

            Assert.AreEqual(23.12f, m.Current);
            Assert.AreEqual(45.0f, m.Temperature);
        }