Exemplo n.º 1
0
        public void ShouldAddNewElement()
        {
            Sut.AddDisabled(Element1.Object);

            Assert.Single(Sut.Disabled);
            Assert.Contains(Element1.Object, Sut.Disabled);
            Assert.DoesNotContain(Element1.Object, Sut.Enabled);
        }
Exemplo n.º 2
0
        public void ShouldReturnDefault()
        {
            Sut.AddEnabled(Element2.Object);
            Sut.AddDisabled(Element3.Object);

            var result = Sut.GetValueOrDefault(Element1.Object.Name);

            Assert.Null(result);
        }
Exemplo n.º 3
0
        public void ShouldIgnoreDuplicates()
        {
            Sut.AddDisabled(Element1.Object);
            Sut.AddDisabled(Element1.Object);

            Assert.Single(Sut.Disabled);
            Assert.Contains(Element1.Object, Sut.Disabled);
            Assert.DoesNotContain(Element1.Object, Sut.Enabled);
        }
Exemplo n.º 4
0
        public void ShouldDoNothingOnEnabledElement()
        {
            Sut.AddDisabled(Element1.Object);

            Sut.Disable(Element1.Object.Name);

            Assert.Single(Sut.Disabled);
            Assert.Contains(Element1.Object, Sut.Disabled);
            Assert.DoesNotContain(Element1.Object, Sut.Enabled);
        }
Exemplo n.º 5
0
        public void ShouldReturnEnabledCommand()
        {
            Sut.AddEnabled(Element1.Object);
            Sut.AddEnabled(Element2.Object);
            Sut.AddDisabled(Element3.Object);

            var result = Sut.GetValueOrDefault(Element1.Object.Name);

            Assert.Equal(Element1.Object, result);
        }