示例#1
0
        public void CreateEntityReturnsCalled()
        {
            //Setup
            var mService = new Mock <ITeacherService>();

            mService.Setup(mock => mock.CreateEntity(It.IsAny <TeacherDTO>()));

            //Action
            var controller = new TeacherController(mService.Object);

            controller.CreateEntity(It.IsAny <TeacherDTO>());

            //Assert
            mService.Verify(mock => mock.CreateEntity(It.IsAny <TeacherDTO>()), Times.Once);
        }