示例#1
0
            public void PutsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new StagesClient(connection);

                var editStage = new StageUpdate {
                    Name = "name"
                };

                client.Edit(123, editStage);

                connection.Received().Put <Stage>(Arg.Is <Uri>(u => u.ToString() == "stages/123"),
                                                  Arg.Is <StageUpdate>(nc => nc.Name == "name"));
            }
示例#2
0
            public async Task EnsuresNonNullArguments()
            {
                var client = new StagesClient(Substitute.For <IApiConnection>());

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