Esempio n. 1
0
        public void GetReverse()
        {
            var size0 = new RoixSizeInt(12, 34);
            var size1 = size0.ReverseLength().ReverseLength();

            size0.Is(size1);
            size0.Equals(size1).IsTrue();   // because of record
            (size0 == size1).IsTrue();      // because of record
        }
Esempio n. 2
0
        public void Explicit()
        {
            int x = 1234, y = 5678;
            var size  = new RoixSizeInt(x, y);
            var point = (RoixPointInt)size;

            point.X.Is(x);
            point.Y.Is(y);
        }
Esempio n. 3
0
 public void 幅が負数はダメ(int w, int h)
 {
     Assert.Throws <ArgumentException>(() => new RoixSizeInt(w, h));
     Assert.Throws <ArgumentException>(() =>
     {
         var s0 = new RoixSizeInt(0, 0);
         var s1 = s0 with {
             Width = w, Height = h
         };
     });
 }
Esempio n. 4
0
        public void Ctor(int w, int h)
        {
            var size = new RoixSizeInt(w, h);

            size.Width.Is(w);
            size.Height.Is(h);

            var(w1, h1) = size;
            w1.Is(w);
            h1.Is(h);
        }