Exemplo n.º 1
0
        public void Equality_Default()
        {
            var i1 = new PerspectiveInterval();
            var i2 = new PerspectiveInterval();

            Assert.AreEqual(i1, i2);
        }
Exemplo n.º 2
0
        public void Equality_Perspective()
        {
            var i1 = new PerspectiveInterval {
                Perspective = PerspectiveType.Production
            };
            var i2 = new PerspectiveInterval {
                Perspective = PerspectiveType.Production
            };
            var i3 = new PerspectiveInterval {
                Perspective = PerspectiveType.Debug
            };

            Assert.AreEqual(i1, i2);
            Assert.AreNotEqual(i2, i3);
        }
        private static WatchdogObject ConvertPerspectiveInterval(PerspectiveInterval interval)
        {
            var obj = ConvertBasicInterval(interval);
            // note: there is a third perspective type (Other, "ot")
            string type;

            switch (interval.Perspective)
            {
            case PerspectiveType.Production:
                type = "ja";     // "Java" perspective
                break;

            case PerspectiveType.Debug:
                type = "de";
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            obj.Properties.Add("pet", String(type));
            return(obj);
        }