public void GetUserIDFromUserNameTest() { SymConfig symConfig = new SymConfig(); SymConfigLoader symConfigLoader = new SymConfigLoader(); symConfig = symConfigLoader.loadFromFile("C:/Users/Michael/Documents/Visual Studio 2017/Projects/apiClientDotNet/apiClientDotNetTest/Resources/testConfig.json"); SymBotAuth botAuth = new SymBotAuth(symConfig); botAuth.authenticate(); SymBotClient botClient = SymBotClient.initBot(symConfig, botAuth); UserClient userClient = botClient.getUsersClient(); UserInfo user = userClient.getUserFromUsername("mikepreview"); StreamClient streamClient = botClient.getStreamsClient(); RoomSearchQuery roomSearchQuery = new RoomSearchQuery(); roomSearchQuery.query = "APITestRoom"; roomSearchQuery.active = true; roomSearchQuery.isPrivate = true; NumericId id = new NumericId(); id.id = user.id; roomSearchQuery.member = id; RoomSearchResult result = streamClient.searchRooms(roomSearchQuery, 0, 0); Assert.IsTrue(user != null); }
public void GetUserIdByUserName() { var userClient = botClient.getUsersClient(); var user = userClient.getUserFromUsername(config.GetSection("test_username").Value); Assert.IsNotNull(user); Assert.AreEqual(config.GetSection("test_displayname").Value, user.displayName); }