Ejemplo n.º 1
0
        public void testMaximum(int a, int b, int c)
        {
            GenericsClass <int> genericsClass = new GenericsClass <int>(a, b, c);
            int expected = 4;
            int result   = genericsClass.maxMethod();

            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 2
0
            public InterfaceDriver(GenericsClass <IInterfaceProbe> errorIfFailed)
            {
                object probe = errorIfFailed;

                // We check here whether the object initializing it is of
                // ClassProbe. We don't check against ClassProbe here
                // even though it inherits due to covariance-related
                // limitations
                Consistent = probe is GenericsClass <IInterfaceProbe>;
            }
Ejemplo n.º 3
0
    protected void DisplayValuesButton_Click(object sender, EventArgs e)
    {
        Label.Text = "";
        var ints = new GenericsClass <int>(new int[] { 1, 2, 3, 4, 5 });

        Label.Text = ints.DisplayValues();

        var dubs = new GenericsClass <double>(new double[] { 1.0, -2.3, 3.33, 4.57, 5.8 });

        Label.Text += "<br>" + dubs.DisplayValues();

        var dec = new GenericsClass <decimal>(new decimal[] { 1, 2.1M, 3, 4, 5.45M });

        Label.Text += "<br>" + dec.DisplayValues();
    }
Ejemplo n.º 4
0
        private void InitializeComponent()
        {
            GenericsClass.CalcAllSceensBounds();
            this.SuspendLayout();

            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode       = AutoScaleMode.Font;
            this.BackColor           = System.Drawing.Color.Black;
            this.FormBorderStyle     = FormBorderStyle.None;
            this.MaximizeBox         = false;
            this.MinimizeBox         = false;
            this.ShowInTaskbar       = false;
            this.StartPosition       = FormStartPosition.Manual;
            //this.TopMost = true;//this seems to require focus on show

            this.ClientSize = GenericsClass.ScreenBounds.Size;
            this.Location   = GenericsClass.ScreenBounds.Location;
        }