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

                var editUser = new UserUpdate {
                    Name = "name", Email = "*****@*****.**", ActiveFlag = false
                };

                client.Edit(123, editUser);

                connection.Received().Put <User>(Arg.Is <Uri>(u => u.ToString() == "users/123"),
                                                 Arg.Is <UserUpdate>(df => df.Name == "name" &&
                                                                     df.Email == "*****@*****.**" &&
                                                                     df.ActiveFlag == false));
            }
Esempio n. 2
0
            public async Task EnsuresNonNullArguments()
            {
                var client = new UsersClient(Substitute.For <IApiConnection>());

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