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); }
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); }
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); }
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); }