public void TestMockSuccessfulGetUserInfo_GoodData() { IRpcBroker broker = MockRpcBrokerFactory.GetXusGetUserInfoBroker(true); XusGetUserInfoCommand userInfoCommand = new XusGetUserInfoCommand(broker); RpcResponse response = userInfoCommand.Execute(); // *** Check results *** Assert.IsNotNull(response); Assert.AreEqual(RpcResponseStatus.Success, response.Status); Assert.IsFalse(string.IsNullOrWhiteSpace(userInfoCommand.UserInfo.DUZ), "DUZ is empty"); Assert.IsFalse(string.IsNullOrWhiteSpace(userInfoCommand.UserInfo.Division.Name), "Division is empty"); Assert.IsFalse(string.IsNullOrWhiteSpace(userInfoCommand.UserInfo.DTime), "DTime is empty"); Assert.IsFalse(string.IsNullOrWhiteSpace(userInfoCommand.UserInfo.Name), "Name is empty"); Assert.IsFalse(string.IsNullOrWhiteSpace(userInfoCommand.UserInfo.ServiceSection), "ServiceSection is empty"); Assert.IsFalse(string.IsNullOrWhiteSpace(userInfoCommand.UserInfo.StandardName), "StandardName is empty"); Assert.IsFalse(string.IsNullOrWhiteSpace(userInfoCommand.UserInfo.Title), "Title is empty"); // TODO: Do we care about this? //Assert.IsFalse(string.IsNullOrWhiteSpace(userInfoCommand.UserInfo.Language), "Language is empty"); //Assert.IsFalse(string.IsNullOrWhiteSpace(userInfoCommand.UserInfo.UserClass), "UserClass is empty"); //Assert.IsFalse(string.IsNullOrWhiteSpace(userInfoCommand.UserInfo.Vpid), "Vpid is empty"); //Assert.IsFalse(string.IsNullOrWhiteSpace(userInfoCommand.UserInfo.DefaultLocation), "DefaultLocation is empty"); }
public void TestMockSuccessfulGetUserInfo_BadData() { IRpcBroker broker = MockRpcBrokerFactory.GetXusGetUserInfoBroker(false); XusGetUserInfoCommand userInfoCommand = new XusGetUserInfoCommand(broker); RpcResponse response = userInfoCommand.Execute(); // *** Check results *** Assert.IsNotNull(response); Assert.AreEqual(RpcResponseStatus.Fail, response.Status); }