コード例 #1
0
        public void MusicSelection_MethodAddContributor()
        {
            //Arrange
            Contributor        composer         = new Contributor(new Name("David", "", "Haas"), "Composer");
            MusicSelectionMock myMusicSelection =
                new MusicSelectionMock("9999991e810c19729de860ea", "507f191e810c19729de860ea", "Blest Are They", composer);

            //Act
            Contributor        arranger      = new Contributor(new Name("Billy", "", "Bob"), "Arranger");
            List <Contributor> expectedValue = new List <Contributor>()
            {
                arranger
            };

            myMusicSelection.addContributor(arranger);

            //Assert
            CollectionAssert.AreEqual(expectedValue, myMusicSelection.getContributors());
        }
コード例 #2
0
        public void MusicSelection_RemoveContributor()
        {
            //Arrange
            Contributor        composer         = new Contributor(new Name("David", "", "Haas"), "Composer");
            MusicSelectionMock myMusicSelection =
                new MusicSelectionMock("9999991e810c19729de860ea", "507f191e810c19729de860ea", "Blest Are They", composer);
            Contributor        contributor1  = new Contributor(new Name("Billy", "", "Bob"), "Arranger");
            Contributor        contributor2  = new Contributor(new Name("Jane", "", "Jones"), "Editor");
            Contributor        contributor3  = new Contributor(new Name("Frank", "", "Williams"), "Arranger");
            List <Contributor> expectedValue = new List <Contributor>()
            {
                contributor1, contributor3
            };

            //Act
            myMusicSelection.addContributor(contributor1);
            myMusicSelection.addContributor(contributor2);
            myMusicSelection.addContributor(contributor3);
            myMusicSelection.removeContributor(contributor2);

            //Assert
            CollectionAssert.AreEqual(expectedValue, myMusicSelection.getContributors());
        }