public void ControlStateSubtractionWithTrueIsCombined() { tlog.Debug(tag, $"ControlStateSubtractionWithTrueIsCombined START"); ControlState[] states1 = new ControlState[2]; states1[0] = ControlState.Selected; states1[1] = ControlState.Focused; var testingTarget1 = ControlState.Create(states1); ControlState[] states2 = new ControlState[2]; states2[0] = ControlState.Pressed; states2[1] = ControlState.Focused; var testingTarget2 = ControlState.Create(states2); var result = testingTarget1 - testingTarget2; Assert.AreEqual("Selected", result.ToString(), "Should be equal!"); ControlState[] states3 = new ControlState[2]; states3[0] = ControlState.Selected; states3[1] = ControlState.Focused; var testingTarget3 = ControlState.Create(states3); ControlState[] states4 = new ControlState[2]; states4[0] = ControlState.Pressed; states4[1] = ControlState.Disabled; var testingTarget4 = ControlState.Create(states4); result = testingTarget3 - testingTarget4; Assert.AreEqual("Selected, Focused", result.ToString(), "Should be equal!"); tlog.Debug(tag, $"ControlStateSubtractionWithTrueIsCombined END (OK)"); }
public void ControlStateCreateWithAddedState() { tlog.Debug(tag, $"ControlStateCreateWithAddedState START"); var testingTarget = ControlState.Create("Focused"); Assert.IsNotNull(testingTarget); Assert.AreEqual(ControlState.Focused, testingTarget, "Should be equal!"); tlog.Debug(tag, $"ControlStateCreateWithAddedState END (OK)"); }
public void ControlStateContainsWithFalseIsCombined() { tlog.Debug(tag, $"ControlStateContainsWithFalseIsCombined START"); ControlState[] states = new ControlState[1]; states[0] = ControlState.Normal; var testingTarget = ControlState.Create(states); Assert.AreEqual(true, testingTarget.Contains(ControlState.Normal), "Should be equal!"); tlog.Debug(tag, $"ControlStateContainsWithFalseIsCombined END (OK)"); }
public void ControlStateCreateStateListLengthEqualZero() { tlog.Debug(tag, $"ControlStateCreateStateListLengthEqualZero START"); ControlState[] states = new ControlState[0]; var testingTarget = ControlState.Create(states); Assert.IsNotNull(testingTarget); Assert.AreEqual("Normal", testingTarget.ToString(), "Should be equal!"); tlog.Debug(tag, $"ControlStateCreateStateListLengthEqualZero END (OK)"); }
public void ControlStateCreateStateListLengthEqualOne() { tlog.Debug(tag, $"ControlStateCreateStateListLengthEqualOne START"); ControlState[] states = new ControlState[1]; states[0] = ControlState.Other; var testingTarget = ControlState.Create(states); Assert.IsNotNull(testingTarget); Assert.AreEqual("Other", testingTarget.ToString(), "Should be equal!"); tlog.Debug(tag, $"ControlStateCreateStateListLengthEqualOne END (OK)"); }
public void ControlStateCreateWithEmptyString() { tlog.Debug(tag, $"ControlStateCreateWithEmptyString START"); try { string str = " "; ControlState.Create(str); } catch (ArgumentException e) { tlog.Debug(tag, e.Message.ToString()); tlog.Debug(tag, $"ControlStateCreateWithEmptyString END (OK)"); Assert.Pass("Caught ArgumentException: Passed!"); } }
public void ControlStateContainsWithNullState() { tlog.Debug(tag, $"ControlStateContainsWithNullState START"); ControlState state = ControlState.Create("Focused"); try { state.Contains(null); } catch (ArgumentNullException e) { tlog.Debug(tag, e.Message.ToString()); tlog.Debug(tag, $"ControlStateContainsWithNullState END (OK)"); Assert.Pass("Caught ArgumentNullException: Passed!"); } }
public void ControlStateContains() { tlog.Debug(tag, $"ControlStateContains START"); ControlState[] states = new ControlState[5]; states[0] = ControlState.Normal; states[1] = ControlState.Selected; states[2] = ControlState.Focused; states[3] = ControlState.Pressed; states[4] = ControlState.Disabled; var testingTarget = ControlState.Create(states); Assert.AreEqual(false, testingTarget.Contains(ControlState.All), "Should be equal!"); Assert.AreEqual(true, testingTarget.Contains(ControlState.Selected), "Should be equal!"); tlog.Debug(tag, $"ControlStateContains END (OK)"); }
public void ControlStateCreateStateListContainAll() { tlog.Debug(tag, $"ControlStateCreateStateListContainAll START"); ControlState[] states = new ControlState[5]; states[0] = ControlState.Normal; states[1] = ControlState.Selected; states[2] = ControlState.All; states[3] = ControlState.Pressed; states[4] = ControlState.Disabled; var testingTarget = ControlState.Create(states); Assert.IsNotNull(testingTarget); Assert.AreEqual("All", testingTarget.ToString(), "Should be equal!"); tlog.Debug(tag, $"ControlStateCreateStateListContainAll END (OK)"); }
public void ControlStateCreateStateListLengthGreaterThanOne() { tlog.Debug(tag, $"ControlStateCreateStateListLengthGreaterThanOne START"); ControlState[] states = new ControlState[5]; states[0] = ControlState.Normal; states[1] = ControlState.Selected; states[2] = ControlState.Focused; states[3] = ControlState.Pressed; states[4] = ControlState.Disabled; var testingTarget = ControlState.Create(states); Assert.IsNotNull(testingTarget); Assert.AreEqual("Selected, Focused, Pressed, Disabled", testingTarget.ToString(), "Should be equal!"); tlog.Debug(tag, $"ControlStateCreateStateListLengthGreaterThanOne END (OK)"); }