示例#1
0
        public virtual async void TestGetNotFound()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());
            ApiArtistClientResponseModel response = await client.ArtistGetAsync(default(int));

            response.Should().BeNull();
        }
示例#2
0
        public void MapClientResponseToRequest()
        {
            var mapper = new ApiArtistModelMapper();
            var model  = new ApiArtistClientResponseModel();

            model.SetProperties(1, "A", "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), "A", "A", "A", "A", "A", "A");
            ApiArtistClientRequestModel response = mapper.MapClientResponseToRequest(model);

            response.Should().NotBeNull();
            response.AspNetUserId.Should().Be("A");
            response.Bio.Should().Be("A");
            response.ExternalId.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.Facebook.Should().Be("A");
            response.Name.Should().Be("A");
            response.SoundCloud.Should().Be("A");
            response.Twitter.Should().Be("A");
            response.Venmo.Should().Be("A");
            response.Website.Should().Be("A");
        }
示例#3
0
        public virtual async void TestGetFound()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());
            ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;

            ApiArtistClientResponseModel response = await client.ArtistGetAsync(1);

            response.Should().NotBeNull();
            response.AspNetUserId.Should().Be("A");
            response.Bio.Should().Be("A");
            response.ExternalId.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.Facebook.Should().Be("A");
            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
            response.SoundCloud.Should().Be("A");
            response.Twitter.Should().Be("A");
            response.Venmo.Should().Be("A");
            response.Website.Should().Be("A");
        }