Example #1
0
        public void Add_NonContainedDay_Added()
        {
            // Arrange
            var day  = Fixture.Create <IsoDayOfWeek>();
            var days = Fixture.CreateMany <IsoDayOfWeek>().Where(d => d != day).ToList();
            var set  = new IsoDayOfWeekSet(days);

            set.Should().NotContain(day);

            // Act
            set.Add(day);

            // Assert
            set.Should().Contain(day);
        }
Example #2
0
        public void Remove_NonContainedDay_False()
        {
            // Arrange
            var day  = Fixture.Create <IsoDayOfWeek>();
            var days = Fixture.CreateMany <IsoDayOfWeek>().Where(d => d != day).ToList();
            var set  = new IsoDayOfWeekSet(days);

            set.Should().NotContain(day);

            // Act
            var removed = set.Remove(day);

            // Assert
            removed.Should().BeFalse();
            set.Should().NotContain(day);
        }
Example #3
0
        public void Clear_Empty_Empty()
        {
            // Arrange
            var set = new IsoDayOfWeekSet();

            // Act
            set.Clear();

            // Assert
            set.Should().BeEmpty();
        }
Example #4
0
        public void Add_Empty_Added()
        {
            // Arrange
            var set = new IsoDayOfWeekSet();
            var day = Fixture.Create <IsoDayOfWeek>();

            // Act
            set.Add(day);

            // Assert
            set.Should().Contain(day);
        }
Example #5
0
        public void Count_AllDays_Empty()
        {
            // Arrange
            var days = IsoDayOfWeekSet.WithAllDays;
            var set  = new IsoDayOfWeekSet(days);

            // Act
            set.Clear();

            // Assert
            set.Should().BeEmpty();
        }
Example #6
0
        public void Clear_RandomDays_Empty()
        {
            // Arrange
            var days = Fixture.CreateMany <IsoDayOfWeek>();
            var set  = new IsoDayOfWeekSet(days);

            // Act
            set.Clear();

            // Assert
            set.Should().BeEmpty();
        }
Example #7
0
        public void Remove_Empty_False()
        {
            // Arrange
            var set = new IsoDayOfWeekSet();
            var day = Fixture.Create <IsoDayOfWeek>();

            // Act
            var removed = set.Remove(day);

            // Assert
            removed.Should().BeFalse();
            set.Should().BeEmpty();
        }
Example #8
0
        public void Add_AllDays_True()
        {
            // Arrange
            var days = IsoDayOfWeekSet.WithAllDays;
            var set  = new IsoDayOfWeekSet(days);
            var day  = Fixture.Create <IsoDayOfWeek>();

            // Act
            set.Add(day);

            // Assert
            set.Should().Contain(day);
        }
Example #9
0
        public void Add_ContainedDay_True()
        {
            // Arrange
            var days = Fixture.CreateMany <IsoDayOfWeek>().ToList();
            var set  = new IsoDayOfWeekSet(days);
            var day  = days.Last();

            // Act
            set.Add(day);

            // Assert
            set.Should().Contain(day);
        }
Example #10
0
        public void Remove_ContainedDay_True()
        {
            // Arrange
            var days = Fixture.CreateMany <IsoDayOfWeek>().ToList();
            var set  = new IsoDayOfWeekSet(days);
            var day  = days.Last();

            // Act
            var removed = set.Remove(day);

            // Assert
            removed.Should().BeTrue();
            set.Should().NotContain(day);
        }