示例#1
0
        public void SquadPorIdTriboNotFound()
        {
            // Arrange
            var repoMock = new Mock <ISquadRepositorio>();

            repoMock.Setup(m => m.SelecionarPorIdTribo(0));

            var _squadNegocio = new SquadNegocio(repoMock.Object);

            // Act + Assert
            Assert.Throws <NaoEncontradoException>(() => _squadNegocio.SelecionarPorIdTribo(0));
        }
示例#2
0
        public void SquadPorIdTriboOK()
        {
            // Arrange
            var repoMock = new Mock <ISquadRepositorio>();

            repoMock.Setup(m => m.SelecionarPorIdTribo(1)).Returns(DbMock.Squad);

            var _squadNegocio = new SquadNegocio(repoMock.Object);

            // Act
            var objRetornado = _squadNegocio.SelecionarPorIdTribo(1);

            // Assert
            Assert.NotNull(objRetornado);
        }