public static GetTestSource ( ) : AudioSource | ||
Результат | AudioSource |
public void ToggleIgnoreUnknownSource() { var source = AudioSourceTests.GetTestSource(); Assert.IsFalse(manager.GetIsIgnored(source)); Assert.IsFalse(manager.ToggleIgnore(source)); Assert.IsFalse(manager.GetIsIgnored(source)); }
public void Enumerable() { var source = manager.Create("Name", user, AudioSourceTests.GetTestSource().CodecSettings); var source2 = manager.Create("Name2", user, AudioSourceTests.GetTestSource().CodecSettings); Assert.Contains(source, handler.ToList()); Assert.Contains(source2, handler.ToList()); }
private IEnumerable <AudioSource> CreateSources() { var source = AudioSourceTests.GetTestSource(1, 0); manager.Add(source); var source2 = AudioSourceTests.GetTestSource(2, 1); manager.Add(source2); return(new[] { source, source2 }); }
public void ToggleIgnore() { var source = AudioSourceTests.GetTestSource(); manager.Add(source); Assert.IsFalse(handler.GetIsIgnored(source)); Assert.IsTrue(handler.ToggleIgnore(source)); Assert.IsTrue(handler.GetIsIgnored(source)); Assert.IsFalse(handler.ToggleIgnore(source)); Assert.IsFalse(handler.GetIsIgnored(source)); }
public void Setup() { this.provider = new MockAudioCaptureProvider(); this.source = AudioSourceTests.GetTestSource(); var c = new MockConnectionProvider(GablarskiProtocol.Instance).GetClientConnection(); var client = new MockClientContext(c); this.context = client; this.sender = new ClientSourceHandler(client, new ClientSourceManager(client)); this.receiver = (IAudioReceiver)this.sender; }
public void Add() { CreateSources(); var csource = manager.FirstOrDefault(s => s.Id == 1); Assert.IsNotNull(csource, "Source not found"); AudioSourceTests.AssertSourcesMatch(AudioSourceTests.GetTestSource(1, 0), csource); Assert.IsTrue(manager[context.CurrentUser].Contains(csource), "Owned sources did not contain source"); var source = manager.FirstOrDefault(s => s.Id == 2); Assert.IsNotNull(source, "Source not found"); AudioSourceTests.AssertSourcesMatch(AudioSourceTests.GetTestSource(2, 1), source); }
public void RequestMuteSource() { Assert.Throws <ArgumentNullException> (() => new RequestMuteSourceMessage(null, true)); var source = AudioSourceTests.GetTestSource(2, 4); var msg = new RequestMuteSourceMessage(source, false); msg.WritePayload(null, writer); long length = stream.Position; stream.Position = 0; msg = new RequestMuteSourceMessage(); msg.ReadPayload(null, reader); Assert.AreEqual(length, stream.Position); Assert.AreEqual(source.Id, msg.TargetId); Assert.AreEqual(true, msg.Unmute); }
public void SendAudioDataInvalid() { Assert.Throws <ArgumentException> (() => handler.SendAudioDataAsync(AudioSourceTests.GetTestSource(), TargetType.User, new [] { 1 }, new byte[0][])); Assert.Throws <ArgumentException> (() => handler.SendAudioDataAsync(AudioSourceTests.GetTestSource(2), TargetType.User, new [] { 1 }, new byte[1][])); }
public void SendAudioDataNull() { Assert.Throws <ArgumentNullException> (() => handler.SendAudioDataAsync(null, TargetType.User, new [] { 1 }, new byte[1][])); Assert.Throws <ArgumentNullException> (() => handler.SendAudioDataAsync(AudioSourceTests.GetTestSource(), TargetType.User, null, new byte[1][])); Assert.Throws <ArgumentNullException> (() => handler.SendAudioDataAsync(AudioSourceTests.GetTestSource(), TargetType.User, new [] { 1 }, null)); }