コード例 #1
0
        public void should_be_able_to_add_a_album_without_passing_in_name()
        {
            var newAlbum = AlbumToAdd("5537624c-3d2f-4f5c-8099-df916082c85c", "cc2c9c3c-b7bc-4b8b-84d8-4fbd8779e493");

            GivenValidAlbum(newAlbum.ForeignAlbumId);
            GivenValidPath();

            var album = Subject.AddAlbum(newAlbum);

            album.Title.Should().Be(_fakeAlbum.Title);
        }
コード例 #2
0
        public void should_throw_if_album_cannot_be_found()
        {
            var newAlbum = AlbumToAdd("5537624c-3d2f-4f5c-8099-df916082c85c", "cc2c9c3c-b7bc-4b8b-84d8-4fbd8779e493");

            Mocker.GetMock <IProvideAlbumInfo>()
            .Setup(s => s.GetAlbumInfo(newAlbum.ForeignAlbumId))
            .Throws(new AlbumNotFoundException(newAlbum.ForeignAlbumId));

            Assert.Throws <ValidationException>(() => Subject.AddAlbum(newAlbum));

            ExceptionVerification.ExpectedErrors(1);
        }