public void SpecifyingMessage_PopulatesSettings() { var argumentReader = new TestArgumentReader(@"/M:Message"); var settings = argumentReader.Read(); Assert.AreEqual("Message", settings.Message); }
public void SpecifyingOnlyMessage_PopulatesDefaultValues() { var argumentReader = new TestArgumentReader(@"/M:Message"); var settings = argumentReader.Read(); Assert.AreEqual(true, settings.LightsEnabled); Assert.AreEqual(false, settings.RumblesEnabled); Assert.AreEqual(DefaultLights.White, settings.Colour); Assert.AreEqual(200, settings.UnitLength); Assert.AreEqual(false, settings.RepeatMessage); }
public void Specifying_C_SetsColour(string arg) { var argumentReader = new TestArgumentReader(arg); var settings = argumentReader.Read(); Assert.AreEqual(0, settings.Colour.Red); Assert.AreEqual(0.25f, settings.Colour.Green); Assert.AreEqual(1f, settings.Colour.Blue); }
public void SpecifyingOnlyMessage_DoesNotThrow() { var argumentReader = new TestArgumentReader(@"/M:Message"); Assert.DoesNotThrow(() => argumentReader.Read()); }
public void SpecifyingNoMessage_ThrowsException() { var argumentReader = new TestArgumentReader(@"/D /R"); Assert.Throws<UsageException>(() => argumentReader.Read()); }
public void SpecifyingMessage_WithInvalidCharacters_Throws(string arg) { var argumentReader = new TestArgumentReader(arg); Assert.Throws<UsageException>(() => argumentReader.Read()); }
public void DisablingLightsAndRumbles_ThrowsException() { var argumentReader = new TestArgumentReader(@"/L /M:A"); Assert.Throws<UsageException>(() => argumentReader.Read()); }
public void Specifying_U_WithInvalidLength_Throws(string arg) { var argumentReader = new TestArgumentReader(arg); Assert.Throws<UsageException>(() => argumentReader.Read()); }
public void ValidArguments_ReturnsSettings() { var argumentReader = new TestArgumentReader(@"/M:An example of valid arguments"); var settings = argumentReader.Read(); Assert.AreEqual(typeof(Settings), settings.GetType()); }
public void Specifying_R_EnablesRumbles(string arg) { var argumentReader = new TestArgumentReader(arg); var settings = argumentReader.Read(); Assert.AreEqual(true, settings.RumblesEnabled); }
public void Specifying_U_SetsUnitLength(string arg) { var argumentReader = new TestArgumentReader(arg); var settings = argumentReader.Read(); Assert.AreEqual(200, settings.UnitLength); }
public void Specifying_L_DisablesLights(string arg) { var argumentReader = new TestArgumentReader(arg); var settings = argumentReader.Read(); Assert.AreEqual(false, settings.LightsEnabled); }
public void Specifying_D_SetsRepeatable(string arg) { var argumentReader = new TestArgumentReader(arg); var settings = argumentReader.Read(); Assert.AreEqual(true, settings.RepeatMessage); }
public void Specifying_C_WithValuesOutOfRange_Throws(string arg) { var argumentReader = new TestArgumentReader(arg); Assert.Throws<UsageException>(() => argumentReader.Read()); }
public void Specifying_C_WithIncorrectNumberOfValues_Throws(string arg) { var argumentReader = new TestArgumentReader(arg); Assert.Throws<UsageException>(() => argumentReader.Read()); }
public void Specifying_C_WithAllValuesZero_Throws() { var argumentReader = new TestArgumentReader(@"/C:-0,0,0 /m:A"); Assert.Throws<UsageException>(() => argumentReader.Read()); }