Ejemplo n.º 1
0
        public bool register(ICheckoutClient client, String teamName)
        {
            response = client.put <RegistrationResponse>("/Checkout/Team", new RegistrationRequest {
                name = teamName
            });

            return(response.Item1 == System.Net.HttpStatusCode.Created);
        }
        public void ShouldRegisterTeam()
        {
            // Arrange
            String teamName = "AnyName";
            Team   team     = new Team();

            ICheckoutClient client = A.Fake <ICheckoutClient>(x => x.Strict());

            A.CallTo(() => client.put <RegistrationResponse>("/Checkout/Team", A <RegistrationRequest> .Ignored))
            .ReturnsLazily((String path, Object req) => Tuple.Create(System.Net.HttpStatusCode.Created, new RegistrationResponse {
                acceptedName = ((RegistrationRequest)req).name
            }));

            // Act
            bool registered = team.register(client, teamName);

            // Assert
            Assert.IsTrue(registered);
            Assert.AreEqual(teamName, team.Name);
        }
Ejemplo n.º 3
0
        public bool register(ICheckoutClient client, String teamName)
        {
            response = client.put<RegistrationResponse>("/Checkout/Team", new RegistrationRequest { name = teamName });

            return (response.Item1 == System.Net.HttpStatusCode.Created);
        }