예제 #1
0
        public async Task GetEntriesByNameAsync_Given_ValidInput_Should_GetList()
        {
            _database = Substitute.For <IDatabase>();

            repo = new PhoneBookRepository(_database);

            var payload = new PhoneBookEntry
            {
                Name        = "Jon Doe",
                PhoneNumber = "+2710 555 12 12"
            };

            repo = new PhoneBookRepository(_database);

            var response = await repo.GetEntriesByNameAsync(payload.Name);

            await _database.Received().QueryAsync <PhoneBookEntry>(Arg.Any <string>(), command: System.Data.CommandType.Text);
        }
예제 #2
0
 public async Task <IEnumerable <PhoneBookEntry> > Get()
 {
     return(await _repository.GetEntriesByNameAsync(string.Empty));
 }