示例#1
0
        public async Task GetCustomer_ForNonExistingCustomerId_ReturnsNullAsync()
        {
            var repo = new CustomersInMemRepository(_dataProvider.Object);

            var result = await repo.GetCustomerAsync(666);

            result.Should().BeNull();
        }
示例#2
0
        public void GetCustomer_ForExistingCustomerId_ReturnsCustomerView()
        {
            var repo = new CustomersInMemRepository(_dataProvider.Object);

            MappingsConfiguration.InitializeAutoMapper();

            Task <CustomerViewModel> task = repo.GetCustomerAsync(1);
            var result = task.Result;

            result.Name.Should().Be("c1");
            result.Surname.Should().Be("s1");
        }