Exemplo n.º 1
0
        // DELETE: api/IDProof/5
        public IHttpActionResult Delete(int id)
        {
            IDProof result     = IDProofList.Where(p => p.ID == id).FirstOrDefault();
            var     resultflag = IDProofList.Remove(result);

            return(Ok(resultflag));
        }
Exemplo n.º 2
0
        // PUT: api/IDProof/5
        public IHttpActionResult Put(int id, IDProof value)
        {
            IDProof result = IDProofList.Where(p => p.ID == id).FirstOrDefault();

            result.Type     = value.Type;
            result.Value    = value.Value;
            result.Status   = value.Status;
            result.Comments = value.Comments;
            return(Ok(result));
        }
Exemplo n.º 3
0
        public void PostIDProof()
        {
            // Arrange
            IDProofController controller = new IDProofController();

            IDProof IDProofObj = new IDProof
            {
                Value    = "123456",
                Comments = "Good Work",
            };
            var actResult = controller.Post(IDProofObj);
            // Act
            var result = actResult as OkNegotiatedContentResult <IDProof>;

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Content.ID > 0);
        }
Exemplo n.º 4
0
        public void PutIDProof()
        {
            // Arrange
            IDProofController controller = new IDProofController();

            IDProof IDProofObj = new IDProof
            {
                Value    = "Put request sucessfull",
                Comments = "Good Work",
                ID       = 1
            };
            var actResult = controller.Put(1, IDProofObj);
            // Act
            var result = actResult as OkNegotiatedContentResult <IDProof>;

            // Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Content.Value.Equals("Put request sucessfull"));
        }
Exemplo n.º 5
0
 // POST: api/IDProof
 public IHttpActionResult Post(IDProof value)
 {
     IDProofList.Add(value);
     value.ID = IDProofList.Count;
     return(Ok(value));
 }