Exemplo n.º 1
0
        public async Task When_LocaleId_Is_Equal_0_ThrowException()
        {
            var localeId = 0;

            Func <Task> invoker = async() => { await CrmClient.GetAllTimeZonesWithDisplayNameAsync(localeId, CancellationToken.None); };


            var assert = await invoker.Should().ThrowAsync <WebApiException>()
                         .WithMessage("An unexpected error occurred.");
        }
Exemplo n.º 2
0
        public async Task When_LocaleId_Is_EN_Then_UserName_IsOK()
        {
            var localeId = 1033;

            var collection = await CrmClient.GetAllTimeZonesWithDisplayNameAsync(localeId, CancellationToken.None);

            collection?.Entities?.Should().NotBeNull();

            var timezone = collection?.Entities?.FirstOrDefault(x => x.GetAttributeValue <int>("timezonecode") == 0);

            timezone.Should().NotBeNull();
            timezone.GetAttributeValue <string>("userinterfacename")
            .Should().Be("(GMT-12:00) International Date Line West");
        }