public void ClonedStructShouldBeIdentical() { var original = new Custom(Color.Red); var clone = original.Clone(); Assert.That(clone, Is.EqualTo(original)); }
public void ClonedStructShouldBeIndependent() { var original = new Custom(Color.Red); var clone = original.Clone(); clone.Set(Color.Blue); Assert.That(clone, Is.Not.EqualTo(original)); }
public void ShouldEqualIdenticalEffect() { var a = new Custom(Color.Red); var b = new Custom(Color.Red); Assert.True(a == b); Assert.False(a != b); Assert.True(a.Equals(b)); Assert.AreEqual(a, b); }
public void ShouldEqualIdenticalArray() { var effect = new Custom(Color.Red); var array = new Color[Constants.MaxLeds]; for (var i = 0; i < Constants.MaxLeds; i++) array[i] = Color.Red; Assert.True(effect == array); Assert.False(effect != array); Assert.True(effect.Equals(array)); Assert.AreEqual(effect, array); }
public void Set(Custom effect) { SetGuid(NativeWrapper.CreateMousepadEffect(effect)); }
/// <summary> /// Prevents a default instance of the <see cref="Mousepad" /> class from being created. /// </summary> private Mousepad() { Log.Debug("Mousepad is initializing."); Chroma.InitInstance(); _custom = Custom.Create(); }
public void ShouldGetCorrectColor() { var colors = new Color[Constants.MaxLeds]; colors[5] = Color.Red; var effect = new Custom(colors); Assert.That(effect[5], Is.EqualTo(colors[5])); }
public void ShouldThrowOnInvalidListCount() { var colors = new Color[1]; // ReSharper disable once NotAccessedVariable Custom dummy; Assert.That( () => dummy = new Custom(colors), Throws.InstanceOf<ArgumentException>().With.Property("ParamName").EqualTo("colors")); }
public void ShouldSetCorrectColorsFromList() { var colors = new Color[Constants.MaxLeds]; colors[0] = Color.Red; colors[1] = Color.Blue; colors[2] = Color.Green; var effect = new Custom(colors); for (var i = 0; i < Constants.MaxLeds; i++) Assert.That(effect[i], Is.EqualTo(colors[i])); }
public void ShouldSetAllColorsWithColorConstructor() { var effect = new Custom(Color.Red); for (var i = 0; i < Constants.MaxLeds; i++) Assert.That(effect[i], Is.EqualTo(Color.Red)); }
public void ShouldNotEqualDifferentEffect() { var a = new Custom(Color.Red); var b = new Custom(Color.Blue); Assert.False(a == b); Assert.True(a != b); Assert.False(a.Equals(b)); Assert.AreNotEqual(a, b); }
public void ShouldNotEqualArrayWithInvalidLength() { var effect = new Custom(Color.Red); var array = new[] { Color.Red, Color.Red, Color.Red }; Assert.False(effect == array); Assert.True(effect != array); Assert.False(effect.Equals(array)); Assert.AreNotEqual(effect, array); }