Пример #1
0
        public async Task Create_incorrect_input_returns_0_Integration()
        {
            var logic = new StudyLogic(_repo);

            var response = await logic.Create(null);

            Assert.Equal(0, response);
        }
Пример #2
0
        public async Task Create_correct_input_returns_created_id_Integration()
        {
            var logic = new StudyLogic(_repo);

            var response = await logic.Create(_studyDTO);

            Assert.Equal(_studyDTO.Id, response);
        }
Пример #3
0
        public async Task Create_correct_input_returns_created_id()
        {
            _mock.Setup(m => m.CreateAsync(It.IsAny <StudyDTO>())).ReturnsAsync(_studyDTO.Id);
            var logic = new StudyLogic(_mock.Object);

            var response = await logic.Create(_studyDTO);

            Assert.Equal(_studyDTO.Id, response);
        }
Пример #4
0
        public async Task Create_incorrect_input_returns_0()
        {
            var mock = new Mock <IRepository <StudyDTO> >();

            mock.Setup(m => m.CreateAsync(null)).ReturnsAsync(0);
            var logic = new StudyLogic(mock.Object);

            var response = await logic.Create(null);

            Assert.Equal(0, response);
        }