Exemplo n.º 1
0
        public void Add_InvalidDay_ThrowsException(IsoDayOfWeek day)
        {
            // Arrange
            var set = new IsoDayOfWeekSet();

            // Act
            Action act = () => set.Add(day);

            // Assert
            act.Should().Throw <ArgumentOutOfRangeException>();
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }