Esempio n. 1
0
        public async Task Should_return_empty_when_no_connections()
        {
            var subject = new ConnectionIdStore();

            var actual = await subject.GetConnectionIds(UserId);

            actual.Should().BeEmpty();
        }
Esempio n. 2
0
        public async Task Should_add_connection()
        {
            var subject = new ConnectionIdStore();

            await subject.Add(new ConnectionIdStoreEntry(UserId, "1"));

            var actual = await subject.GetConnectionIds(UserId);

            actual.Should().BeEquivalentTo("1");
        }
Esempio n. 3
0
        public async Task Should_return_empty_when_no_connections_via_removing()
        {
            var subject = new ConnectionIdStore();

            await subject.Add(new ConnectionIdStoreEntry(UserId, "1"));

            await subject.Remove(new ConnectionIdStoreEntry(UserId, "1"));

            var actual = await subject.GetConnectionIds(UserId);

            actual.Should().BeEmpty();
        }
Esempio n. 4
0
        public async Task Should_return_connection_via_removing()
        {
            var subject = new ConnectionIdStore();

            await subject.Add(new ConnectionIdStoreEntry(UserId, "1"));

            await subject.Add(new ConnectionIdStoreEntry(UserId, "2"));

            await subject.Remove(new ConnectionIdStoreEntry(UserId, "1"));

            var actual = await subject.GetConnectionIds(UserId);

            actual.Should().BeEquivalentTo("2");
        }