public void MessagesMadeFromSetContainKeyGivenToConstructor(string key) { Chatbase.MessageSet set = new Chatbase.MessageSet(key); Chatbase.Message msg = set.NewMessage(); Assert.Equal(msg.api_key, key); set.Add(msg); Assert.Equal(set.GetMessages().Count, 1); }
public void SendingValidSetReturnsSuccess(string uid, string plt, string ver) { string key = Environment.GetEnvironmentVariable("CB_TEST_API_KEY"); if (String.IsNullOrEmpty(key)) { ChatbaseClientUnitTests.PrintNoAPIKeyWarning(); } else { Chatbase.MessageSet set = new Chatbase.MessageSet(key); Chatbase.Message msg = set.NewMessage(); msg.user_id = uid; msg.platform = plt; msg.version = ver; set.Add(msg); var resp = _client.Send(set).Result; Assert.Equal(resp.StatusCode, HttpStatusCode.OK); } }