コード例 #1
0
        public void CreateWrestlerUploadAndDeleteAttachmentTest(WrestlerModel model)
        {
            var id = Wrestler.Create(model);

            var attachModel = Wrestler.UploadAttachment(id, PathToFiles + model.attaches[0].filename);
            var result      = Wrestler.DeleteAttachment(attachModel.id).result;

            Assert.AreEqual(true, Boolean.Parse(result));
        }
コード例 #2
0
        public void CreateWrestlerTest(WrestlerModel model)
        {
            var id = Wrestler.Create(model);

            // compare models
            var modelCurrent = Wrestler.Read(id);

            model.CompareModels(modelCurrent);
        }
コード例 #3
0
        public void CreateWrestlerWithPhotoAttachmentAPITest(WrestlerModel model)
        {
            var id = Wrestler.Create(model);

            var attachModel = Wrestler.UploadPhoto(id, PathToFiles + model.attaches[0].filename);

            //compare models
            var modelCurrent = Wrestler.Read(id);

            model.CompareModels(modelCurrent);
        }
コード例 #4
0
        public void CreateWrestlerWithTwoTextAttachmentsTest(WrestlerModel model)
        {
            var id = Wrestler.Create(model);

            for (int i = 0; i < model.attaches.Count; i++)
            {
                var attachModel = Wrestler.UploadAttachment(id, PathToFiles + model.attaches[i].filename);

                //compare attachment model
            }
        }
コード例 #5
0
ファイル: WrestlerAPI.cs プロジェクト: a-lavrov/WrestlerTests
        public WrestlerModel Update(WrestlerModel model)
        {
            var request = new RestRequest()
            {
                Method        = Method.PUT,
                Resource      = "/wrestler/update.php",
                RequestFormat = DataFormat.Json
            };

            request.AddBody(model);

            return(Execute <WrestlerModel>(request));
        }
コード例 #6
0
ファイル: WrestlerAPI.cs プロジェクト: a-lavrov/WrestlerTests
        public string Create(WrestlerModel model)
        {
            var request = new RestRequest()
            {
                Method        = Method.POST,
                Resource      = "/wrestler/create.php",
                RequestFormat = DataFormat.Json
            };

            request.AddBody(model);

            var responseModel = Execute <WrestlerModel>(request);

            return(responseModel.id);
        }