示例#1
0
        public void GetCampaign_GetsCampaignById()
        {
            // Arrange
            var user = new User
            {
                UserId    = "U1",
                Campaigns = new List <Campaign>()
                {
                    new Campaign {
                        CampaignId = 1, Name = "Campaign 1"
                    },
                    new Campaign {
                        CampaignId = 2, Name = "Campaign 2"
                    }
                }
            };
            var resolver = new UserResolvers();

            // Act
            var campaign = resolver.GetCampaign(user, 2);

            // Assert
            Assert.True(string.Equals("Campaign 2", campaign.Name));
        }
示例#2
0
        public void GetCampaigns_GetsUsersCampaigns()
        {
            // Arrange
            var user = new User
            {
                UserId    = "U1",
                Campaigns = new List <Campaign>()
                {
                    new Campaign {
                        CampaignId = 1
                    },
                    new Campaign {
                        CampaignId = 2
                    }
                }
            };
            var resolver = new UserResolvers();

            // Act
            var campaigns = resolver.GetCampaigns(user);

            // Assert
            Assert.Equal(2, campaigns.Count());
        }
示例#3
0
 public Mutation(UserResolvers userResolvers, ClientResolvers clientResolvers)
 {
     _userResolvers   = userResolvers;
     _clientResolvers = clientResolvers;
 }
示例#4
0
 public Query(UserResolvers userResolvers, ClientResolvers clientResolvers)
 {
     _userResolvers   = userResolvers;
     _clientResolvers = clientResolvers;
 }
示例#5
0
 public ClientType(UserResolvers userResolvers)
 {
     _userResolvers = userResolvers;
 }