Exemple #1
0
        public async Task Throws_ArgumentException_On_Bad_Username(string username)
        {
            using (var s = new SoulseekClient())
            {
                var ex = await Record.ExceptionAsync(() => s.ConnectToUserAsync(username));

                Assert.NotNull(ex);
                Assert.IsType <ArgumentException>(ex);
            }
        }
Exemple #2
0
        public async Task ConnectToUserAsync_Throws_InvalidOperationException_If_Logged_In(SoulseekClientStates state)
        {
            using (var s = new SoulseekClient())
            {
                s.SetProperty("State", state);

                var ex = await Record.ExceptionAsync(() => s.ConnectToUserAsync("a"));

                Assert.NotNull(ex);
                Assert.IsType <InvalidOperationException>(ex);
            }
        }