Пример #1
0
        public void GetInstrumentsByName_ValidId_ReturnsResult()
        {
            // Arrange
            var result = fixture.Create <IEnumerable <Instrument> >();

            instrumentRepository.GetInstrumentsByName(Arg.Any <string>()).Returns(result);

            // Act
            var serviceResult = instrumentService.GetInstrumentsByName("test");

            // Assert
            Assert.IsNotNull(serviceResult);
            Assert.AreEqual(serviceResult.Count(), result.Count());
        }
Пример #2
0
 /// <summary>
 /// Retrieves a list of instruments by his name
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public IEnumerable <Instrument> GetInstrumentsByName(string name)
 {
     return(instrumentRepository.GetInstrumentsByName(name));
 }
 public void OnGet()
 {
     Instruments = instrumentRepository.GetInstrumentsByName(SearchTerm);
 }
 /// <summary>
 /// Retrieves a list of instruments by his name
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public IEnumerable <InstrumentDto> GetInstrumentsByName(string name)
 {
     return(ParserIEnumInstrument(instrumentRepository.GetInstrumentsByName(name)));
 }