public void ChargeBatteryTestCommonCase() { mockOutput.Clear(); IOutput output = mockOutput; string expected = "iChargeUnit is charging phone.\r\n"; var chargeObj = new iChargeUnit(output); chargeObj.ChargeBattery(null); string actual = output.ToString(); Assert.AreEqual(expected, actual); }
public void Error_0() { Description desc = new Description("width", "The rectangle width", eROLE.NAMED, new ParamString(), eSCOPE.REQUIRED, eMULTIPLICITY.ONCE); MockOutput mock = new MockOutput(); OutputMessages messages = new OutputMessages(CliOptions.WindowsStyle, mock); mock.Clear(); messages.Error(desc, eERROR.REQUIRED); CollectionAssert.AreEqual(new[] { "GemsCLI: option '/width' is required." }, mock.getLines()); mock.Clear(); messages.Error(desc, eERROR.DUPLICATE); CollectionAssert.AreEqual(new[] { "GemsCLI: option '/width' can only be used once." }, mock.getLines()); mock.Clear(); messages.Error(desc, eERROR.MISSING_VALUE); CollectionAssert.AreEqual(new[] { "GemsCLI: option '/width' is missing value." }, mock.getLines()); }
public void PlayTestCommonCase() { mockOutput.Clear(); IOutput output = mockOutput; string expected = "iPhoneHeadset play sound.\r\n"; var phoneObj = new iPhoneHeadset(output); phoneObj.Play(null); string actual = output.ToString(); Assert.AreEqual(expected, actual); }
public void ConnectToOperatorTestCommonCase() { mockOutput.Clear(); IOutput output = mockOutput; string expected = "KievStar operator is connected.\r\n"; var simCard = new KievStarSimCard(output); simCard.ConnectToOperator(null); string actual = output.ToString(); Assert.AreEqual(expected, actual); }