Beispiel #1
0
        public void Get()
        {
            _repo.Setup(m => m.GetAll()).Returns(GetTechnologies());
            var result = _controller.Get() as List <Technology>;

            Assert.Equal(3, result.Count);
        }
        public void GetById()
        {
            _repo.Setup(m => m.GetById(123)).Returns(GetTechnologies()[0]);
            var result = _controller.Get(123) as Technology;

            Assert.Equal(123, result.SkillId);
            Assert.NotNull(result);
        }
        public void Get_ReturnAOkObjectResult_GetOneTechnologyByID()
        {
            //Arrange
            var _skillRepository     = new SkillRepository(DbContextMocker.GetTechnologyContext());
            var _tecnologyController = new TechnologyController(_skillRepository);

            // Act
            var response = _tecnologyController.Get(1);

            // Assert
            Assert.IsType <OkObjectResult>(response);
        }
Beispiel #4
0
        public void Get_ReturnOkObjectResult_GetTechnologyDetails_PerformanceTest()
        {
            //Arrange
            var _skillRepository     = new SkillRepository(DbContextMocker.GetTechnologyContext());
            var _tecnologyController = new TechnologyController(_skillRepository);

            // Act
            var response = _tecnologyController.Get();

            // Assert
            var okObjectResult = Assert.IsType <OkObjectResult>(response);
            var data           = Assert.IsAssignableFrom <List <Skill> >(okObjectResult.Value);

            Assert.True(data.Count >= 0);
        }