Esempio n. 1
0
            public void PutsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new ActivitiesClient(connection);

                var editActivity = new ActivityUpdate {
                    Subject = "subject", Type = "type"
                };

                client.Edit(123, editActivity);

                connection.Received().Put <Activity>(Arg.Is <Uri>(u => u.ToString() == "activities/123"),
                                                     Arg.Is <ActivityUpdate>(nc => nc.Subject == "subject" &&
                                                                             nc.Type == "type"));
            }
Esempio n. 2
0
            public async Task EnsuresNonNullArguments()
            {
                var client = new ActivitiesClient(Substitute.For <IApiConnection>());

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.Edit(1, null));
            }