Esempio n. 1
0
        public void GetInstrumentById_ValidId_ReturnsResult()
        {
            // Arrange
            var result = fixture.Create <Instrument>();

            instrumentRepository.GetById(Arg.Any <int>()).Returns(result);

            // Act
            var serviceResult = instrumentService.GetInstrumentById(1);

            // Assert
            Assert.IsNotNull(serviceResult);
            Assert.AreEqual(serviceResult.Id, result.Id);
        }
Esempio n. 2
0
        public IHttpActionResult GetById(int id)
        {
            InstrumentService instrumentService = CreateInstrumentService();
            var instrument = instrumentService.GetInstrumentById(id);

            return(Ok(instrument));
        }