public void TestConstructorsCorrectlySetProperties() { XboxParty party = new XboxParty(this.xboxConsole, TestTitleId); Assert.AreSame(this.xboxConsole, party.Console); Assert.AreEqual(TestTitleId, party.TitleId); party = XboxParty.FromTitleId(this.xboxConsole, TestTitleId); Assert.AreSame(this.xboxConsole, party.Console); Assert.AreEqual(TestTitleId, party.TitleId); }
public void TestInviteToPartyInvokesAdapterInviteToParty() { bool isCorrectMethodCalled = false; ShimXboxConsoleAdapterBase.AllInstances.InviteToPartyStringUInt32StringStringArray = (adapter, systemIpAddress, titleId, actingUserXuid, inviteUserXuids) => { isCorrectMethodCalled = true; Assert.AreEqual(TestTitleId, titleId); Assert.AreEqual(TestXuidString, actingUserXuid); Assert.IsNotNull(inviteUserXuids); Assert.AreEqual(1, inviteUserXuids.Length); Assert.AreEqual(TestXuidString, inviteUserXuids[0]); }; this.CreateTestUser().InviteToParty(XboxParty.FromTitleId(this.xboxConsole, TestTitleId), new XboxRemoteUser[] { this.CreateTestRemoteUser() }); Assert.IsTrue(isCorrectMethodCalled, "XboxUser method did not call the correct Adapter method."); }
public void TestPartyIdCallsAdapterGetPartyId() { bool isCorrectMethodCalled = false; ShimXboxConsoleAdapterBase.AllInstances.GetPartyIdStringUInt32 = (adapter, systemIpAddress, titleId) => { isCorrectMethodCalled = true; Assert.AreEqual(ConsoleAddress, systemIpAddress); Assert.AreEqual(TestTitleId, titleId); return(TestPartyId); }; XboxParty party = new XboxParty(this.xboxConsole, TestTitleId); Assert.AreEqual(TestPartyId, party.PartyId); Assert.IsTrue(isCorrectMethodCalled, "XboxParty PartyId property did not call Adapter GetPartyId."); }