Пример #1
0
        public void AddValidData_Return_OkResult()
        {
            //arrange
            ClinicalDataAccessLayer testClinicalAccess = new ClinicalDataAccessLayer();
            Clinical data = new Clinical()
            {
                Name = "Test Name", WhatIs = "Test What Is"
            };
            int expected = 1; //1 = successfully added to DB

            //act
            int result = testClinicalAccess.AddClinical(data);

            //assert
            Assert.Equal(expected, result);
        }
Пример #2
0
        public void AddInvalidData_Return_BadRquest()
        {
            //arrange
            ClinicalDataAccessLayer testClinicalAccess = new ClinicalDataAccessLayer();
            Clinical data = new Clinical()
            {
                WhatIs = null
            };
            int expected = 0; // 0 = not added successfully to DB

            //act
            int result = testClinicalAccess.AddClinical(data);

            //assert
            Assert.Equal(expected, result);
        }
Пример #3
0
 public int Create([FromBody] Clinical clinical)
 {
     return(objclinical.AddClinical(clinical));
 }