public void TestSignOutHandlesIncorrectReturn() { XboxUser user = this.CreateTestUser(); ShimXboxConsoleAdapterBase.AllInstances.SignOutUserStringXboxUserDefinition = (adapter, systemIpAddress, userDefinition) => { return(new XboxUserDefinition(TestUserId, "DifferentEmail", null, false)); }; user.SignOut(); }
public void TestSignOutHandlesNullReturn() { XboxUser user = this.CreateTestUser(); ShimXboxConsoleAdapterBase.AllInstances.SignOutUserStringXboxUserDefinition = (adapter, systemIpAddress, userDefinition) => { return(null); }; user.SignOut(); }
public void TestSignOutInvokesAdapterSignOut() { XboxUser user = this.CreateTestUser(); bool isCorrectMethodCalled = false; ShimXboxConsoleAdapterBase.AllInstances.SignOutUserStringXboxUserDefinition = (adapter, systemIpAddress, userDefinition) => { isCorrectMethodCalled = true; return(this.CreateTestUserDefinition()); }; user.SignOut(); Assert.IsTrue(isCorrectMethodCalled, "The SignOut method didn't call the adapter's SignOutUser(systemIpAddress, userDefinition)."); }
public void TestSignOutPassesArguments() { const uint ExpectedUserId = TestUserId; const string ExpectedEmailAddress = TestEmailAddress; const string ExpectedGamerTag = TestGamertag; const bool ExpectedIsSignedInValue = false; XboxUser user = new XboxUser(this.xboxConsole, ExpectedUserId, ExpectedEmailAddress, ExpectedGamerTag, !ExpectedIsSignedInValue); ShimXboxConsoleAdapterBase.AllInstances.SignOutUserStringXboxUserDefinition = (adapter, systemIpAddress, userDefinition) => { Assert.AreSame(user.Definition, userDefinition, "The passed in XboxUserDefinition was not the same as the expected user definition."); return(new XboxUserDefinition(userDefinition.UserId, userDefinition.EmailAddress, userDefinition.Gamertag, ExpectedIsSignedInValue)); }; user.SignOut(); Assert.AreEqual(ExpectedIsSignedInValue, user.IsSignedIn, "The SignOut method didn't set the users IsSignedIn property based on return value."); }