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); }
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); }
public void Clear_Empty_Empty() { // Arrange var set = new IsoDayOfWeekSet(); // Act set.Clear(); // Assert set.Should().BeEmpty(); }
public void Add_Empty_Added() { // Arrange var set = new IsoDayOfWeekSet(); var day = Fixture.Create <IsoDayOfWeek>(); // Act set.Add(day); // Assert set.Should().Contain(day); }
public void Count_AllDays_Empty() { // Arrange var days = IsoDayOfWeekSet.WithAllDays; var set = new IsoDayOfWeekSet(days); // Act set.Clear(); // Assert set.Should().BeEmpty(); }
public void Clear_RandomDays_Empty() { // Arrange var days = Fixture.CreateMany <IsoDayOfWeek>(); var set = new IsoDayOfWeekSet(days); // Act set.Clear(); // Assert set.Should().BeEmpty(); }
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(); }
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); }
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); }
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); }