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; } }
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; } }
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()); }
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(); }
public static void Foo(this IRock <ITarget> @this, Argument <int> a) => @this.Handle(_ => _.Foo(a.Value));
private void RegisterRock <TService>(IRock <TService> rock) where TService : class { var maked = rock.Make(); base.Container.RegisterInstanceAs(maked, finalizerDelegate: m => rock.Verify()); }