public async Task Does_not_create_a_connection_if_ConnectionTypes_do_not_match_and_sets_Error_to_InvalidOperation() { var createConnectionCommand = new CreateConnectionCommand(componentWithWebRtcAudioOutput.Id, 1, componentWithUdpAudioInput.Id, 1); await createConnectionCommand.Process(virtualStudio); Assert.IsTrue(createConnectionCommand.Error.Type == ErrorType.InvalidOperation); Assert.IsTrue(virtualStudio.Connections.Count == 0); }
public async Task Does_not_create_a_connection_between_two_inputs() { var createConnectionCommand = new CreateConnectionCommand(componentWithWebRtcAudioInput.Id, 1, componentWithWebRtcAudioInput.Id, 1); await createConnectionCommand.Process(virtualStudio); Assert.IsTrue(createConnectionCommand.Error.Type == ErrorType.NotFound); Assert.IsTrue(virtualStudio.Connections.Count == 0); }
public async Task Does_not_create_a_connection_with_components_that_only_exist_in_the_ComponentRepository() { var createConnectionCommand = new CreateConnectionCommand(componentWithUdpAudioOutput.Id, 1, componentWithUdpAudioInputInRepository.Id, 1); var success = await createConnectionCommand.Process(virtualStudio); Assert.IsFalse(success); Assert.IsNotNull(createConnectionCommand.Error); Assert.AreEqual(ErrorType.NotFound, createConnectionCommand.Error.Type); }
public async Task Does_not_create_a_connection_when_the_output_input_is_already_connected() { var createConnectionCommand = new CreateConnectionCommand(componentWithWebRtcAudioOutput.Id, 1, componentWithWebRtcAudioInput.Id, 1); await createConnectionCommand.Process(virtualStudio); createConnectionCommand = new CreateConnectionCommand(componentWithWebRtcAudioOutput.Id, 1, componentWithWebRtcAudioInput.Id, 1); await createConnectionCommand.Process(virtualStudio); Assert.IsTrue(createConnectionCommand.Error.Type == ErrorType.InvalidOperation); Assert.IsTrue(virtualStudio.Connections.Count == 1); }
public async Task Create_connections_between_compatible_input_and_output() { var createConnectionCommand = new CreateConnectionCommand(componentWithUdpAudioOutput.Id, 1, componentWithUdpAudioInput.Id, 1); await createConnectionCommand.Process(virtualStudio); Assert.IsNull(createConnectionCommand.Error); createConnectionCommand = new CreateConnectionCommand(componentWithWebRtcAudioOutput.Id, 1, componentWithWebRtcAudioInput.Id, 1); await createConnectionCommand.Process(virtualStudio); Assert.IsNull(createConnectionCommand.Error); createConnectionCommand = new CreateConnectionCommand(componentWithWebRtcVideoOutput.Id, 1, componentWithWebRtcVideoInput.Id, 1); await createConnectionCommand.Process(virtualStudio); Assert.IsNull(createConnectionCommand.Error); Assert.IsTrue(virtualStudio.Connections.Count == 3); }