private void signalOperationButton_Click(object sender, EventArgs e) { if (_signal2 == null) { return; } var param = int.Parse(operationSamplesTextBox.Text); switch (operationComboBox.Text) { case "Delay by": _signal2 = _signal2.Delay(param); break; case "Repeat times": _signal2 = _signal2.Repeat(param); break; } _signal3 = _signal1 == null ? _signal2 : _signal1.Superimpose(_signal2); generatedSignalPanel.Signal = _signal2; superimposedSignalPanel.Signal = _signal3; }
public void TestRepeat() { //Act var repeated1 = _small.Repeat(3); //Assert Assert.That(repeated1.Samples, Is.EqualTo(new float[] { 5, 2, 4, 5, 2, 4, 5, 2, 4 })); }
public void TestRepeatNegativeTimes() { Assert.Throws <ArgumentException>(() => { _signal.Repeat(-2); }); }