public void MusicSelection_MethodAddTag_AttemptToAddDuplicateTag_DoesNotAddTheTag() { //Arrange Contributor composer = new Contributor(new Name("David", "", "Haas"), "Composer"); MusicSelectionMock myMusicSelection = new MusicSelectionMock("9999991e810c19729de860ea", "507f191e810c19729de860ea", "Blest Are They", composer); Tag myTag = new Tag("Easter"); myMusicSelection.addTag(myTag); //Act myMusicSelection.addTag(myTag); //Assert Assert.AreEqual(1, myMusicSelection.getTags().Count); }
public void MusicSelection_MethodRemoveTag() { //Arrange Contributor composer = new Contributor(new Name("David", "", "Haas"), "Composer"); MusicSelectionMock myMusicSelection = new MusicSelectionMock("9999991e810c19729de860ea", "507f191e810c19729de860ea", "Blest Are They", composer); Tag myTag = new Tag("Easter"); Tag myTag2 = new Tag("Lent"); myMusicSelection.addTag(myTag); myMusicSelection.addTag(myTag2); List <Tag> expectedValue = new List <Tag> { myTag }; //Act myMusicSelection.removeTag(myTag2); //Assert CollectionAssert.AreEqual(expectedValue, myMusicSelection.getTags()); }
public void MusicSelection_MethodRemoveTag_ArgumentTagIsNull_ThrowsArgumentNullException() { //Arrange Contributor composer = new Contributor(new Name("David", "", "Haas"), "Composer"); MusicSelectionMock myMusicSelection = new MusicSelectionMock("9999991e810c19729de860ea", "507f191e810c19729de860ea", "Blest Are They", composer); Tag myTag = new Tag("Easter"); myMusicSelection.addTag(myTag); //Act myMusicSelection.removeTag(null); }
public void MusicSelection_MethodAddTag_AddingNewTag() { //Arrange Contributor composer = new Contributor(new Name("David", "", "Haas"), "Composer"); MusicSelectionMock myMusicSelection = new MusicSelectionMock("9999991e810c19729de860ea", "507f191e810c19729de860ea", "Blest Are They", composer); Tag myTag = new Tag("Easter"); //Act myMusicSelection.addTag(myTag); //Assert Assert.AreEqual(myTag.TagName, myMusicSelection.getTags()[0].TagName); }