Ejemplo n.º 1
0
        public void SnapshotProbeTimeSpan_CanBeCreated()
        {
            Test.Begin("SnapshotProbeTimeSpan can be created");
            var x = TimeSpan.FromSeconds(60);
            var a = new Telemetry.CustomProbeTimeSpan(() => x);

            var s = new Telemetry.SnapshotProbeTimeSpan(a);

            Test.IsTrue(s.Value == TimeSpan.FromSeconds(0));
            Test.End();
        }
Ejemplo n.º 2
0
        public void SnapshotProbeTimeSpan_Works()
        {
            Test.Begin("SnapshotProbeTimeSpan works");
            var x = TimeSpan.FromSeconds(60);
            var a = new Telemetry.CustomProbeTimeSpan(() => x);

            var s = new Telemetry.SnapshotProbeTimeSpan(a);

            x = TimeSpan.FromSeconds(70);
            Test.IsTrue(s.Value == TimeSpan.FromSeconds(10.0));

            x = TimeSpan.FromSeconds(120);
            Test.IsTrue(s.Value == TimeSpan.FromSeconds(60.0));

            x = TimeSpan.FromSeconds(0);
            Test.IsTrue(s.Value == TimeSpan.FromSeconds(-60.0));
            Test.End();
        }