public void When_AllFieldsAreFilledByCorrectData_Expect_SuccessfulUseCreation()
        {
            //Assign
            var request = new CreateWrestlerRequest
            {
                Wrestler = new SimpleWrestler
                {
                    fname      = "test",
                    lname      = "test",
                    mname      = "test",
                    dob        = "25-05-1994",//DateTime.Now.ToString("dd-MM-yyyy"),
                    region1    = 3,
                    fst1       = 2,
                    style      = 1,
                    lictype    = 1,
                    card_state = 1,
                    expires    = 2015
                }
            };

            var client = new WrestlerClient("auto", "test");
            //Act
            var response = client.CreateWrestler(request);

            //Assert
            Assert.IsNotNull(response);
            Assert.IsTrue(response.id > 0);
            Assert.IsTrue(response.result);
        }
Exemplo n.º 2
0
 public void When_PassNegativeId_Expect_UserNotFoundError()
 {
     //Assign
     int testId  = -666;
     var client  = new WrestlerClient("auto", "test");
     var request = new DeleteWrestlerRequest
     {
         Id = testId
     };
     //Act
     var response = client.DeleteWrestler(request);
 }
Exemplo n.º 3
0
 public void When_UserDoesNotExistInDB_Expect_UserNotFoundError()
 {
     //Assign
     int testId  = 0000;
     var client  = new WrestlerClient("auto", "test");
     var request = new DeleteWrestlerRequest
     {
         Id = testId
     };
     //Act
     var response = client.DeleteWrestler(request);
 }
Exemplo n.º 4
0
        public void Precondition_result()
        {
            //Assign
            int testId = 3629;
            var client = new WrestlerClient("auto", "test");
            //Act
            var response = client.ReadWrestlerById(testId);
            var wrestler = Converter.JsonResponseToWrestler(response);

            //Assert
            Assert.IsNotNull(wrestler);
        }
Exemplo n.º 5
0
        public void When_UserExistInDB_Expect_SuccessfulDeletion()
        {
            //Assign
            int testId  = 3792;
            var client  = new WrestlerClient("auto", "test");
            var request = new DeleteWrestlerRequest
            {
                Id = testId
            };
            //Act
            var response = client.DeleteWrestler(request);

            //Assert
            Assert.IsNotNull(response);
            Assert.IsTrue(response.result);
        }
 public void When_FirstNameFieldIsEmpty_Expect_Error()
 {
     //Assign
     var request = new CreateWrestlerRequest
     {
         Wrestler = new SimpleWrestler
         {
             fname      = "",
             lname      = "test",
             mname      = "test",
             dob        = "25-05-1994",//DateTime.Now.ToString("dd-MM-yyyy"),
             region1    = 3,
             fst1       = 2,
             style      = 1,
             lictype    = 1,
             card_state = 1,
             expires    = 2015
         }
     };
     var client = new WrestlerClient("auto", "test");
     //Act
     var result = client.CreateWrestler(request);
 }