示例#1
0
            public void WhenDecreaseMinusExistingGoesUnderMin_ThenSetToMin()
            {
                var sut = new SonosVolume(20);

                sut.Decrease(21);

                Assert.That(sut.Value, Is.EqualTo(SonosVolume.MinVolume));
            }
示例#2
0
            public void WhenDecrease_ThenSetToExistingMinusDecrease()
            {
                var sut = new SonosVolume(50);

                sut.Decrease(20);

                Assert.That(sut.Value, Is.EqualTo(30));
            }
示例#3
0
            public void WhenDecreaseAmountIsLessThanZero_ThenThrowException()
            {
                var sut = new SonosVolume(50);

                Assert.Throws <ArgumentOutOfRangeException>(() => sut.Decrease(-1));
            }