public static InfrastructureQuery ToInfrastructure(this DomainQuery @this)
 {
     return(new InfrastructureQuery()
     {
         Url = @this.Url,
         ActionDescriptor = @this.ActionDescriptor,
         Result = @this.Result
     });
 }
        public void IsEmailAddressInUse_WhenEmailIsNotInUse_ShouldReturnFalse()
        {
            var unitOfWork = GetTestUnitOfWorkWith(GetTestUserRepositoryWith(null));

            var domainQuery = new DomainQuery(unitOfWork);

            const string email   = "*****@*****.**";
            var          isInUse = domainQuery.IsEmailInUse(email).Result;

            Assert.False(isInUse);
        }
        public void IsEmailAddressInUse_WhenEmailIsInUse_ShouldReturnTrue()
        {
            const string email = "*****@*****.**";

            var user = new User(new Mock <IDomainQuery>().Object);

            user.SetEmail(email).Wait();

            var unitOfWork = GetTestUnitOfWorkWith(GetTestUserRepositoryWith(user));

            var domainQuery = new DomainQuery(unitOfWork);

            var isInUse = domainQuery.IsEmailInUse(email).Result;

            Assert.True(isInUse);
        }
 public CountryController(CustomerQuery customerQuery, DomainQuery domainQuery)
 {
     _customerQuery = customerQuery;
     _domainQuery   = domainQuery;
 }
 public IEnumerable <Domain> List(DomainQuery query = null, CancellationToken?cancellationToken = default(CancellationToken?))
 {
     return(_context.Invoke(f => f.List(query, cancellationToken)));
 }
Beispiel #6
0
 public void AddQuery(DomainQuery query)
 {
     _queryRepository.AddQuery(query?.ToInfrastructure());
 }