Beispiel #1
0
        public void NamedVersionIsItself()
        {
            var original = new NamedColor("Derp");
            var copy = original.Name;

            Assert.That(original, Is.SameAs(copy));
        }
Beispiel #2
0
        public void RgbVersionReturnsNullForInvalidNames(string nameValue)
        {
            var name = new NamedColor(nameValue);
            var rgb = name.RedGreenBlue;

            Assert.That(rgb, Is.Null);
        }
Beispiel #3
0
        public void RgbVersionWorks(string nameValue, byte red, byte green, byte blue)
        {
            var name = new NamedColor(nameValue);
            var rgb = name.RedGreenBlue;

            Assert.That(rgb.Red, Is.EqualTo(red));
            Assert.That(rgb.Green, Is.EqualTo(green));
            Assert.That(rgb.Blue, Is.EqualTo(blue));
        }
Beispiel #4
0
        public void ItSavesValuesCorrectly()
        {
            var color = new NamedColor("Derp");

            Assert.That(color.Value, Is.EqualTo("Derp"));
        }