示例#1
0
        public async Task ShouldReturnEmployee()
        {
            var employeeId = Guid.NewGuid();
            var companyId  = Guid.NewGuid();
            var tenantId   = Guid.NewGuid();

            var expected = new Employee()
            {
                Id        = employeeId,
                CompanyId = companyId,
                TenantId  = tenantId,
            };
            var employees = new List <Employee>()
            {
                expected,
                new Employee()
                {
                    Id = Guid.NewGuid(),
                }
            };

            _mock.Mock <IInventContext>()
            .Setup(context => context.Employees)
            .ReturnsAsDbSet(employees);

            var actual = await _provider.GetByIdAsync(employeeId);

            ContentAssert.AreEqual(expected, actual);
        }