コード例 #1
0
            public void PutsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new DealFieldsClient(connection);

                var editDealField = new DealFieldUpdate {
                    Name = "name", Options = "{}"
                };

                client.Edit(123, editDealField);

                connection.Received().Put <DealField>(Arg.Is <Uri>(u => u.ToString() == "dealFields/123"),
                                                      Arg.Is <DealFieldUpdate>(df => df.Name == "name" &&
                                                                               (string)df.Options == "{}"));
            }
コード例 #2
0
            public async Task EnsuresNonNullArguments()
            {
                var client = new DealFieldsClient(Substitute.For <IApiConnection>());

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