コード例 #1
0
        public void InvalidPostShouldReturnAnErrorMessage()
        {
            Models.User u = new Models.User
            {
                country = "SA",
                dateOfBirth = "950312"

            };
            // Arrange
            IDManagementController controller = new IDManagementController();

            // Act
            Models.ResponseObject res = controller.Post(u);

            // Assert
            Assert.AreEqual("Some of the required fields were empty", res.message);
            Assert.IsTrue(res.id == null);
        }
コード例 #2
0
        public void SuccessfullPostShouldReturnAValidID()
        {
            Models.User u = new  Models.User
            {
                country = "SA",
                dateOfBirth = "950312",
                gender = "male"

            };
            // Arrange
            IDManagementController controller = new IDManagementController();

            // Act
            Models.ResponseObject res = controller.Post(u);

            // Assert
            Assert.AreEqual("success", res.message);
            Assert.IsFalse(res.id == null);
            Assert.IsTrue(res.id.ToString().Length == 13);
        }