예제 #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (checkFields())
     {
         inter = new Diamond(maxKarat, maxRockWeight, weight, Color.Aqua, checkBox2.Checked, checkBox3.Checked, dopColor);
         Bitmap   bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
         Graphics gr  = Graphics.FromImage(bmp);
         inter.drawRock(gr);
         pictureBox1.Image = bmp;
     }
 }
예제 #2
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (checkFields())
     {
         inter = new Rock(maxKarat, maxRockWeight, weight, Color.Brown);
         Bitmap   bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
         Graphics gr  = Graphics.FromImage(bmp);
         inter.drawRock(gr);
         pictureBox1.Image = bmp;
     }
 }
예제 #3
0
        public MetadataReferenceCacheBenchmark()
        {
            var options = new RockOptions(caching: CachingOption.GenerateNewVersion);

            this.iaRock = Rock.Create <IA>(options);
            this.iaRock.Handle(_ => _.Foo());
            this.ibRock = Rock.Create <IB>(options);
            this.ibRock.Handle(_ => _.Foo());
            this.icRock = Rock.Create <IC>(options);
            this.icRock.Handle(_ => _.Foo());
            this.idRock = Rock.Create <ID>(options);
            this.idRock.Handle(_ => _.Foo());
        }
예제 #4
0
        public VerifyOnly()
        {
            stub = new ThingStub();
            stub.DoSomething();

            fake = A.Fake <IThingy>();
            fake.DoSomething();

            mock = new Mock <IThingy>();
            mock.Object.DoSomething();

            sub = Substitute.For <IThingy>();
            sub.DoSomething();

            rock = Rock.Create <IThingy>();
            rock.Handle(r => r.DoSomething());
            rock.Make().DoSomething();
        }
예제 #5
0
 public static void Foo(this IRock <ITarget> @this, Argument <int> a) =>
 @this.Handle(_ => _.Foo(a.Value));
예제 #6
0
        private void RegisterRock <TService>(IRock <TService> rock) where TService : class
        {
            var maked = rock.Make();

            base.Container.RegisterInstanceAs(maked, finalizerDelegate: m => rock.Verify());
        }