public void ReturnTrueIfPlayerIsEitherSenderOrReceiver()
        {
            var invite = new InviteDataModel(SenderId, ReceiverId, PartyId);

            Assert.True(invite.PlayerInvolved(SenderId));
            Assert.True(invite.PlayerInvolved(ReceiverId));
        }
예제 #2
0
 internal static void AssertEquivalent(InviteDataModel expected, InviteProto actual)
 {
     Assert.AreEqual(expected.Id, actual.Id);
     Assert.AreEqual(expected.SenderId, actual.SenderPlayerId);
     Assert.AreEqual(expected.ReceiverId, actual.ReceiverPlayerId);
     Assert.AreEqual(expected.PartyId, actual.PartyId);
     Assert.AreEqual(ConvertToProto(expected.CurrentStatus), actual.CurrentStatus);
     CollectionAssert.AreEquivalent(expected.Metadata, actual.Metadata);
 }
        public void SetUp()
        {
            _storedInvite          = new InviteDataModel(SenderPlayerId, ReceiverPlayerId, PartyId, _metadata);
            _mockTransaction       = new Mock <ITransaction>(MockBehavior.Strict);
            _mockMemoryStoreClient = new Mock <IMemoryStoreClient>(MockBehavior.Strict);
            _mockMemoryStoreClient.Setup(client => client.CreateTransaction()).Returns(_mockTransaction.Object);
            _mockMemoryStoreClient.Setup(client => client.Dispose()).Verifiable();

            var memoryStoreClientManager = new Mock <IMemoryStoreClientManager <IMemoryStoreClient> >(MockBehavior.Strict);

            memoryStoreClientManager.Setup(manager => manager.GetClient()).Returns(_mockMemoryStoreClient.Object);
            _inviteService = new InviteServiceImpl(memoryStoreClientManager.Object);
        }
        public void ReturnFalseIfIsNeitherSenderNorReceiver()
        {
            var invite = new InviteDataModel(SenderId, ReceiverId, PartyId);

            Assert.False(invite.PlayerInvolved("SomeoneElse"));
        }