Ejemplo n.º 1
0
        public void Normalize(float expectedTurns, string expectedString, float value, HueUnit?unit)
        {
            var collection = new HueCollection();

            if (unit == null)
            {
                collection.Add(value);
            }
            else
            {
                collection.Add(value, unit.Value);
            }

            Assert.AreEqual(expectedTurns, collection[0], 0.01f);
            Assert.AreEqual(expectedString, collection.ToString());
        }
Ejemplo n.º 2
0
        public void Remove()
        {
            var collection = new HueCollection();

            collection.Add(180, HueUnit.Degrees);

            Assert.AreEqual(1, collection.Count);

            collection.Remove(0.57f);
            collection.Remove(0.57f, HueUnit.Turns);

            Assert.AreEqual(1, collection.Count);

            collection.Remove(0.5f, HueUnit.Turns);

            Assert.AreEqual(0, collection.Count);
        }