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

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

                await Assert.ThrowsAsync <ArgumentException>(() => client.GetArchive("", 69));
            }
Ejemplo n.º 2
0
            public void RequestsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new MigrationsClient(connection);

                client.GetArchive("fake", 69);

                connection.Connection.Received().Get <byte[]>(
                    Arg.Is <Uri>(u => u.ToString() == "orgs/fake/migrations/69/archive"),
                    null,
                    "application/vnd.github.wyandotte-preview+json");
            }
Ejemplo n.º 3
0
            public void RequestsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new MigrationsClient(connection);

                client.GetArchive("fake", 69);

                connection.Connection.Received().Get <byte[]>(
                    Arg.Is <Uri>(u => u.ToString() == "orgs/fake/migrations/69/archive"),
                    null,
                    AcceptHeaders.MigrationsApiPreview);
            }
            public async Task EnsuresNonNullAndNonEmptyArguments()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new MigrationsClient(connection);

                await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetArchive(null, 69));
                await Assert.ThrowsAsync<ArgumentException>(() => client.GetArchive("", 69));
            }
            public void RequestsCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new MigrationsClient(connection);

                client.GetArchive("fake", 69);

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