public void Create_Has_View()
        {
            var id     = 1;
            var result = underTest.Create(id);

            Assert.IsType <ViewResult>(result);
        }
        public void Create_a_Song_Returns_a_View()
        {
            var expectedId = 3;
            var testResult = DUT.Create(expectedId);

            Assert.IsType <ViewResult>(testResult);
        }
        public void Can_Create_Song()
        {
            int expectedId = 2;
            var songRepo   = new SongRepository(null);
            var underTest  = new SongController(songRepo);

            var result = underTest.Create(expectedId);

            Assert.IsType <ViewResult>(result);
        }
Exemplo n.º 4
0
        public async Task PostTest()
        {
            var actual = await controller.Create(new Song()
            {
                Name = "CreateSong", UserId = "1"
            });

            Assert.IsType <CreatedResult>(actual);
            CreatedResult result = actual as CreatedResult;
            var           item   = result.Value as Song;

            Assert.Equal("CreateSong", item.Name);
        }
Exemplo n.º 5
0
        public async Task Create()
        {
            var artist = repository.Save(CreateEntry.Artist(ArtistType.Producer));

            var model = new Create {
                NameOriginal = "Arabian Response",
                PVUrl        = "http://www.nicovideo.jp/watch/sm32982184",
                Artists      = new[] {
                    new ArtistForSongContract {
                        Artist = new ArtistContract(artist, ContentLanguagePreference.Default)
                    }
                }
            };

            var result = await controller.Create(model);

            Assert.IsInstanceOfType(result, typeof(RedirectToRouteResult), "result");
            var routeResult = (RedirectToRouteResult)result;

            Assert.AreEqual("Edit", routeResult.RouteValues["Action"], "Action");

            Assert.AreEqual(1, repository.List <Song>().Count, "Song was created");
        }
        public void Check_Song_Created()
        {
            var result = underTest.Create(1);

            Assert.IsType <ViewResult>(result);
        }