public async Task NewUserConnectsAndStreamsData()
        {
            Mock <IHubCallerClients <ISpectatorClient> > mockClients = new Mock <IHubCallerClients <ISpectatorClient> >();
            Mock <ISpectatorClient> mockReceiver = new Mock <ISpectatorClient>();

            mockClients.Setup(clients => clients.All).Returns(mockReceiver.Object);
            mockClients.Setup(clients => clients.Group(SpectatorHub.GetGroupId(streamer_id))).Returns(mockReceiver.Object);

            Mock <HubCallerContext> mockContext = new Mock <HubCallerContext>();

            mockContext.Setup(context => context.UserIdentifier).Returns(streamer_id.ToString());
            hub.Context = mockContext.Object;
            hub.Clients = mockClients.Object;

            await hub.BeginPlaySession(new SpectatorState(88));

            // check all other users were informed that streaming began
            mockClients.Verify(clients => clients.All, Times.Once);
            mockReceiver.Verify(clients => clients.UserBeganPlaying(streamer_id, It.Is <SpectatorState>(m => m.Equals(state))), Times.Once());

            // check state data was added
            var cacheState = await cache.GetStringAsync(SpectatorHub.GetStateId(streamer_id));

            Assert.Equal(state, JsonConvert.DeserializeObject <SpectatorState>(cacheState));

            var data = new FrameDataBundle(new[] { new LegacyReplayFrame(1234, 0, 0, ReplayButtonState.None) });

            // check streaming data is propagating to watchers
            await hub.SendFrameData(data);

            mockReceiver.Verify(clients => clients.UserSentFrames(streamer_id, data));
        }
        public async Task RemoveAsync_FunctionWithoutParameters_ShouldBeRemoved()
        {
            var key = _distributedCacheService.GetKey(() => _testFunctions.FunctionWithoutParameters());

            await _memoryDistributedCache.SetStringAsync(key, JsonConvert.SerializeObject(Value));

            var beforeRemove = await _memoryDistributedCache.GetStringAsync(key);

            await _distributedCacheService.RemoveAsync(() => _testFunctions.FunctionWithoutParameters());

            var afterRemove = await _memoryDistributedCache.GetStringAsync(key);

            beforeRemove.Should().NotBeNull();
            afterRemove.Should().BeNull();
        }