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

                var newDealField = new NewDealField("name", FieldType.org);

                client.Create(newDealField);

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

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.Create(null));
            }