public async Task EnsuresNonNullAndNonEmptyArguments()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new MigrationsClient(connection);

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.Get(null, 69));
                await Assert.ThrowsAsync<ArgumentException>(() => client.Get("", 69));
            }
예제 #2
0
            public async Task EnsuresNonNullAndNonEmptyArguments()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new MigrationsClient(connection);

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.Get(null, 69));

                await Assert.ThrowsAsync <ArgumentException>(() => client.Get("", 69));
            }
예제 #3
0
            public void RequestsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new MigrationsClient(connection);

                client.Get("fake", 69);

                connection.Received().Get <Migration>(
                    Arg.Is <Uri>(u => u.ToString() == "orgs/fake/migrations/69"),
                    null,
                    "application/vnd.github.wyandotte-preview+json");
            }
예제 #4
0
            public void RequestsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new MigrationsClient(connection);

                client.Get("fake", 69);

                connection.Received().Get <Migration>(
                    Arg.Is <Uri>(u => u.ToString() == "orgs/fake/migrations/69"),
                    null,
                    AcceptHeaders.MigrationsApiPreview);
            }
            public void RequestsCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new MigrationsClient(connection);

                client.Get("fake", 69);

                connection.Received().Get<Migration>(
                    Arg.Is<Uri>(u => u.ToString() == "orgs/fake/migrations/69"),
                    null,
                    AcceptHeaders.MigrationsApiPreview);
            }