示例#1
0
        public void OptionSetMapper_Can_Parse_Response_JSON()
        {
            OptionSetMapper.AddOptionSetMapping(_jsonResponseForTest);

            OptionSetMapper.OptionMapping.OptionSetDict.ContainsKey("test_sync_states").Should().BeTrue();
            OptionSetMapper.OptionMapping.OptionSetDict["test_sync_states"].Count.Should().Be(3);
            OptionSetMapper.ToOptionSet("Synchronized", "test_sync_states").Should().Be(1);
        }
示例#2
0
        private async Task InitOptionSetsAsync()
        {
            var message  = ConstructMessage(HttpMethod.Get, $"{BaseUrl}/GlobalOptionSetDefinitions");
            var response = await _client.SendAsync(message);

            var responseContent = await response.Content.ReadAsStringAsync();

            OptionSetMapper.AddOptionSetMapping(responseContent);
        }
示例#3
0
        public void OptionSetMapper_Should_Be_Able_To_Map_OptionSetValues_Enums()
        {
            OptionSetMapper.AddOptionSetMapping(_jsonResponseForTest);

            var lead = new LeadEntity
            {
                SyncState = SyncStates.Error
            };

            lead.CommitChanges();
            lead.Attributes["test_sync_state"].Should().Be(3);
        }
示例#4
0
        public void OptionSetMapper_Should_Be_Able_To_Map_OptionSetValues()
        {
            OptionSetMapper.AddOptionSetMapping(_jsonResponseForTest);

            var account = new AccountEntity
            {
                SyncState = "Out of Sync"
            };

            account.CommitChanges();
            account.Attributes["test_sync_state"].Should().Be(2);
        }