• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# WireDataFormat类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中WireDataFormat的典型用法代码示例。如果您正苦于以下问题:C# WireDataFormat类的具体用法?C# WireDataFormat怎么用?C# WireDataFormat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WireDataFormat类属于命名空间,在下文中一共展示了WireDataFormat类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Register_WhenProvidedWithANonDefaultDomain_CreatesANewPageOnThatDomain

        public void Register_WhenProvidedWithANonDefaultDomain_CreatesANewPageOnThatDomain(WireDataFormat format)
        {
            var client = TestContext.CreateClientValidRflCredentials(format);
            var domain = TestConfigurationsHelper.GetProperty<ITestConfigurations, string>(x => x.RflDomain);
            client.SetWhiteLabelDomain(domain);

			var pageClient = new PageApi(client.HttpChannel);
            
            var pageShortName = "api-test-" + Guid.NewGuid();
            
            var pageCreationRequest = new RegisterPageRequest
            {
                ActivityType = null,
                Attribution =  null,
                CharityId = 2050,
                PageShortName = pageShortName,
                PageTitle = "Page created on domain " + domain + " by an integration test",
                EventDate = null,
                EventName = null,
                EventId = TestConfigurationsHelper.GetProperty<ITestConfigurations, int>(x => x.RflEventReference), //Was 1 for local
                TargetAmount = null
            };

            var registrationResponse = pageClient.Create(pageCreationRequest);

            Assert.That(registrationResponse.Next.Uri, Is.StringContaining(domain));
        }
开发者ID:pawelsawicz,项目名称:JustGiving.Api.Sdk,代码行数:27,代码来源:PageApiTests.cs


示例2: RegisterWhenProvidedWithADomainThatDoesNotExist_ThrowsException

        public void RegisterWhenProvidedWithADomainThatDoesNotExist_ThrowsException(WireDataFormat format)
        {
            const string domainThatDoesNotExistOnJustGiving = "Incorrect.com";

            var client = TestContext.CreateClientValidCredentials(format);
            client.SetWhiteLabelDomain(domainThatDoesNotExistOnJustGiving);

            var pageClient = new PageApi(client.HttpChannel);
            var pageShortName = "api-test-" + Guid.NewGuid();
            var pageCreationRequest = new RegisterPageRequest
            {
                ActivityType = null,
                PageShortName = pageShortName,
                PageTitle = "api test",
                EventName = "The Other Occasion of ApTest and APITest",
                CharityId = 2050,
                EventId = 1,
                TargetAmount = 20M,
                EventDate = DateTime.Now.AddDays(5)
            };

            var exception = Assert.Throws<ErrorResponseException>(() => pageClient.Create(pageCreationRequest));

            Assert.That(exception.Response.StatusCode, Is.EqualTo(HttpStatusCode.BadRequest));
        }
开发者ID:RJacksonm1,项目名称:JustGiving.Api.Sdk,代码行数:25,代码来源:PageApiTests.cs


示例3: ListAllPages_WhenSuppliedEmailIsValid_ListsPages

        public void ListAllPages_WhenSuppliedEmailIsValid_ListsPages(WireDataFormat format)
        {
            var client = TestContext.CreateClientInvalidCredentials(format);
			var accountClient = new AccountApi(client.HttpChannel);

            accountClient.ListAllPages("[email protected]");
        }
开发者ID:pawelsawicz,项目名称:JustGiving.Api.Sdk,代码行数:7,代码来源:AccountApiTests.cs


示例4: RetrievePages_IssuedWithKnownIdAndPage2_ReturnsPages

        public void RetrievePages_IssuedWithKnownIdAndPage2_ReturnsPages(WireDataFormat format)
        {
            var client = TestContext.CreateClientNoCredentials(format);
			var eventApi = new EventApi(client.HttpChannel);

            eventApi.RetrievePages(479546, 20, 2); // VLM 2011 on local dev
        }
开发者ID:RJacksonm1,项目名称:JustGiving.Api.Sdk,代码行数:7,代码来源:EventApiTests.cs


示例5: RetrieveEvent_IssuedWithKnownId_ReturnsEvent

        public void RetrieveEvent_IssuedWithKnownId_ReturnsEvent(WireDataFormat format)
        {
            var client = TestContext.CreateClientNoCredentials(format);
			var eventApi = new EventApi(client.HttpChannel);

            eventApi.Retrieve(479546); // VLM 2011 on local dev
        }
开发者ID:RJacksonm1,项目名称:JustGiving.Api.Sdk,代码行数:7,代码来源:EventApiTests.cs


示例6: RetrieveEvents_WhenDoesntSuppliedCredentials_ReturnsEvents

        public void RetrieveEvents_WhenDoesntSuppliedCredentials_ReturnsEvents(WireDataFormat format)
        {
            var client = TestContext.CreateClientNoCredentials(format);
			var charityClient = new CharityApi(client.HttpChannel);
            var response = charityClient.RetrieveEvents(2357);
            Assert.That(response, Is.Not.Null);
            Assert.That(response.CharityId, Is.Not.EqualTo(0));
        }
开发者ID:RJacksonm1,项目名称:JustGiving.Api.Sdk,代码行数:8,代码来源:CharityApiTests.cs


示例7: InMemorySearch_KeywordWithKnownResults_SearchResultsPresent

 public void InMemorySearch_KeywordWithKnownResults_SearchResultsPresent(WireDataFormat format)
 {
     var client = TestContext.CreateClientNoCredentials(format);
     var searchClient = new SearchApi(client.HttpChannel);
     
     var items = searchClient.InMemorySearch(null, "James", "Morrison", null);
     Assert.IsTrue(items.Results.Any());
 }
开发者ID:pawelsawicz,项目名称:JustGiving.Api.Sdk,代码行数:8,代码来源:SearchApiTests.cs


示例8: EventSearch_KeywordWithKnownResults_SearchResultsPresent

        public void EventSearch_KeywordWithKnownResults_SearchResultsPresent(WireDataFormat format)
        {
            var client = TestContext.CreateClientNoCredentials(format);
            var searchClient = new SearchApi(client.HttpChannel);

            var items = searchClient.EventSearch("Test");
            Assert.IsTrue(items.Results.Any());
        }
开发者ID:pawelsawicz,项目名称:JustGiving.Api.Sdk,代码行数:8,代码来源:SearchApiTests.cs


示例9: TeamExists_AndATeamDoesntExist_ReturnsFalse

		public void TeamExists_AndATeamDoesntExist_ReturnsFalse(WireDataFormat format)
        {
			WithAValidClient(format);
			
			var existsResponse = _api.TeamExists(Guid.NewGuid().ToString());

			Assert.That(existsResponse, Is.False);
        }
开发者ID:pawelsawicz,项目名称:JustGiving.Api.Sdk,代码行数:8,代码来源:TeamApiTests.cs


示例10: ResourceExists_ReturnsPayment

        public void ResourceExists_ReturnsPayment(WireDataFormat format, bool isZipSupported)
        {
            var clientConfiguration = GetDefaultDataClientConfiguration()
               .With((clientConfig) => clientConfig.WireDataFormat = format)
               .With((clientConfig) => clientConfig.IsZipSupportedByClient = isZipSupported);

            Assert.IsNotNull(GetPayment(clientConfiguration));
        }
开发者ID:RJacksonm1,项目名称:JustGiving.Api.Sdk,代码行数:8,代码来源:PaymentsApiClient_GiftAidReportTests.cs


示例11: IsEmailRegistered_WhenSuppliedKnownEmail_ReturnsTrue

        public void IsEmailRegistered_WhenSuppliedKnownEmail_ReturnsTrue(WireDataFormat format)
        {
            var client = TestContext.CreateClientInvalidCredentials(format);
			var accountClient = new AccountApi(client.HttpChannel);

            var exists = accountClient.IsEmailRegistered(TestContext.TestUsername);

            Assert.IsTrue(exists);
        }
开发者ID:pawelsawicz,项目名称:JustGiving.Api.Sdk,代码行数:9,代码来源:AccountApiTests.cs


示例12: GetDonationStatus_WhenSuppliedWithKnownExistingDonationId_ReturnsDonationStatus

        public void GetDonationStatus_WhenSuppliedWithKnownExistingDonationId_ReturnsDonationStatus(WireDataFormat format)
        {
            var client = TestContext.CreateClientValidCredentials(format);
            var donationClient = new DonationApi(client.HttpChannel);

            var status = donationClient.RetrieveStatus(20905200);

            Assert.IsNotNull(status);
        }
开发者ID:RJacksonm1,项目名称:JustGiving.Api.Sdk,代码行数:9,代码来源:DonationApiTests.cs


示例13: IsEmailRegistered_WhenSuppliedEmailUnlikelyToExist_ReturnsFalse

        public void IsEmailRegistered_WhenSuppliedEmailUnlikelyToExist_ReturnsFalse(WireDataFormat format)
        {
            var client = TestContext.CreateClientInvalidCredentials(format);
			var accountClient = new AccountApi(client.HttpChannel);

            var exists = accountClient.IsEmailRegistered(Guid.NewGuid().ToString() + "@justgiving.com"); 

            Assert.IsFalse(exists);
        }
开发者ID:pawelsawicz,项目名称:JustGiving.Api.Sdk,代码行数:9,代码来源:AccountApiTests.cs


示例14: CreateClientValidRflCredentials

 public static JustGivingClient CreateClientValidRflCredentials(WireDataFormat wireDataFormat)
 {
     var cfg = new ClientConfiguration(ApiLocation, ApiKey, 1)
     {
         Username = RflUserName,
         Password = TestValidPassword,
         WireDataFormat = wireDataFormat
     };
     return new JustGivingClient(cfg);
 }
开发者ID:pawelsawicz,项目名称:JustGiving.Api.Sdk,代码行数:10,代码来源:TestContext.cs


示例15: GetRememberPersonCollectionData_WhenProvidedWithValidPersonId_ReturnsRememberPersonCollectionData

        public void GetRememberPersonCollectionData_WhenProvidedWithValidPersonId_ReturnsRememberPersonCollectionData(WireDataFormat format)
        {
            var client = TestContext.CreateClientValidCredentials(format);
            var inMemoryClient = new InMemoryApi(client.HttpChannel);
            int rememberPersonId = 71;

            var retrieveCollectionData = inMemoryClient.RetrieveCollectionData(rememberPersonId);

            Assert.Greater(retrieveCollectionData.Pages.Length, 0);
        }
开发者ID:RJacksonm1,项目名称:JustGiving.Api.Sdk,代码行数:10,代码来源:InMemoryApiTests.cs


示例16: GetRememberPerson_WhenProvidedWithValidPersonId_ReturnsRememberPersonDetails

        public void GetRememberPerson_WhenProvidedWithValidPersonId_ReturnsRememberPersonDetails(WireDataFormat format)
        {
            var client = TestContext.CreateClientValidCredentials(format);
			var inMemoryClient = new InMemoryApi(client.HttpChannel);
            int rememberPersonId = 71;

            var response = inMemoryClient.Retrieve(rememberPersonId);

            Assert.AreEqual(response.RememberedPerson.Id, rememberPersonId);
            Assert.That(response.CollectionUri, Is.StringContaining(string.Format("remember/{0}/", response.RememberedPerson.Id)));
        }
开发者ID:RJacksonm1,项目名称:JustGiving.Api.Sdk,代码行数:11,代码来源:InMemoryApiTests.cs


示例17: CreateClientValidCredentials

        public static JustGivingClient CreateClientValidCredentials(WireDataFormat wireDataFormat, string username = null, string password = null)
        {
            var cfg = new ClientConfiguration(ApiLocation, ApiKey, 1)
            {
                Username = username ?? TestUsername,
                Password = password ?? TestValidPassword,
                WireDataFormat = wireDataFormat
            };

            return new JustGivingClient(cfg);
        }
开发者ID:pawelsawicz,项目名称:JustGiving.Api.Sdk,代码行数:11,代码来源:TestContext.cs


示例18: Register_WhenSuppliedEmailIsUnused_AccountIsCreatedAndEmailAddressReturned

        public void Register_WhenSuppliedEmailIsUnused_AccountIsCreatedAndEmailAddressReturned(WireDataFormat format)
        {
            var client = TestContext.CreateClientInvalidCredentials(format);
			var accountClient = new AccountApi(client.HttpChannel);
            var email = Guid.NewGuid() + "@tempuri.org";
            var request = CreateValidRegisterAccountRequest(email);

            var registeredUsersEmail = accountClient.Create(request);

            Assert.AreEqual(email, registeredUsersEmail);
        }
开发者ID:pawelsawicz,项目名称:JustGiving.Api.Sdk,代码行数:11,代码来源:AccountApiTests.cs


示例19: InMemorySearch_KeywordWithOnlyLastName_ReturnsError_NotingFirstNameIsMandatory

        public void InMemorySearch_KeywordWithOnlyLastName_ReturnsError_NotingFirstNameIsMandatory(WireDataFormat format)
        {
            var client = TestContext.CreateClientNoCredentials(format);
            var searchClient = new SearchApi(client.HttpChannel);

            var exception = Assert.Throws<ErrorResponseException>(() => searchClient.InMemorySearch(null, null, "Morrison", null));

            Assert.That(exception.Errors.Count, Is.EqualTo(1));
            Assert.That(exception.Errors[0].Id, Is.EqualTo("InvalidFirstName"));
            Assert.That(exception.Errors[0].Description, Is.EqualTo("The first name of the person you're remembering cannot be empty."));
        }
开发者ID:RJacksonm1,项目名称:JustGiving.Api.Sdk,代码行数:11,代码来源:SearchApiTests.cs


示例20: RetrieveCharity_IssuedWithKnownId_ReturnsCharity

        public void RetrieveCharity_IssuedWithKnownId_ReturnsCharity(WireDataFormat format)
        {
            var client = TestContext.CreateClientNoCredentials(format);
			var charityClient = new CharityApi(client.HttpChannel);

            var item = charityClient.Retrieve(2050);

            Assert.IsNotNull(item);
            Assert.That(item.Name, Is.StringContaining("The Demo Charity"));
            Assert.That(item.SmsShortName, Is.StringMatching("Your Charity Campaign"));
        }
开发者ID:RJacksonm1,项目名称:JustGiving.Api.Sdk,代码行数:11,代码来源:CharityApiTests.cs



注:本文中的WireDataFormat类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WireProtocol类代码示例发布时间:2022-05-24
下一篇:
C# WindsorContainer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap