コード例 #1
0
        public void When_PulsedWaveform_Expect_Reference()
        {
            double v1 = -1, v2 = 3.3;
            double td = 1e-8, tr = 1e-9, tf = 2e-9, pw = 1e-8, per = 10e-8;
            var    pulse = new Pulse(v1, v2, td, tr, tf, pw, per);

            pulse.Setup();

            // Simulate a few points of interest
            Assert.AreEqual(v1, pulse.At(0.0), 1e-12);
            Assert.AreEqual(v1, pulse.At(td), 1e-12);
            Assert.AreEqual(v2, pulse.At(td + tr), 1e-12);
            Assert.AreEqual(v2, pulse.At(td + tr + pw), 1e-12);
            Assert.AreEqual(v1, pulse.At(td + tr + pw + tf), 1e-12);
            Assert.AreEqual(v1, pulse.At(td + per), 1e-12);
        }