void Test() { TestForm testForm = new TestForm(); testForm.number = 123; testForm.text = "456"; testForm.lowerTest = new LowerTest[3]; LowerTest lower = new LowerTest(); lower.lowerLevel = 21; lower.lowerName = "lower"; testForm.lowerTest[0] = lower; testForm.lowerTest[2] = lower; string json = JsonMapper.ToJson(testForm); Debug.LogError("Json: " + json); Debug.LogError(""); TestForm result = JsonMapper.ToObject<TestForm>(json); Debug.LogError("Number = " + result.number + " text = " + result.text); Debug.LogError("Lower[0]= " + JsonMapper.ToJson(result.lowerTest[0])); Debug.LogError("Lower[1]= " + result.lowerTest[1]); Debug.LogError("Lower[2]= " + JsonMapper.ToJson(result.lowerTest[0])); }
public int OpenForm(int a) { TestForm form = new TestForm(); form.ShowDialog(); return(a * a); }
public TestSceneForms() { HoloTrackForm form; BufferedContainer container = new BufferedContainer { RelativeSizeAxes = Axes.Both, Child = new Box { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(100), Rotation = 45, } }; AddRange(new Drawable[] { container, form = new TestForm(container) { Size = new Vector2(400, 300), Anchor = Anchor.Centre, Origin = Anchor.Centre, } }); AddToggleStep("toggle titlebar", v => form.TitleBarVisibility = v); }
public void SmokeTestWindowsForm() { var target = new ActivationForViewFetcher(); using (var form = new TestForm()) { var formActivator = target.GetActivationForView(form); int formActivateCount = 0, formDeActivateCount = 0; formActivator.Item1.Subscribe(_ => formActivateCount++); formActivator.Item2.Subscribe(_ => formDeActivateCount++); Assert.Equal(0, formActivateCount); Assert.Equal(0, formDeActivateCount); form.Visible = true; Assert.Equal(1, formActivateCount); form.Visible = false; Assert.Equal(1, formActivateCount); Assert.Equal(1, formDeActivateCount); form.Visible = true; Assert.Equal(2, formActivateCount); form.Close(); Assert.Equal(2, formDeActivateCount); } }
public void CloseForm() { if (testform != null) { testform.Close(); testform.Dispose(); testform = null; } if (selfform != null) { selfform.Close(); selfform.Dispose(); selfform = null; } if (profileform != null) { profileform.Close(); profileform.Dispose(); profileform = null; } if (logform != null) { logform.Close(); logform.Dispose(); logform = null; } if (optionform != null) { optionform.Close(); optionform.Dispose(); optionform = null; } }
private void AutoTest_Click(object sender, EventArgs e) { TestForm tf = new TestForm(); tf.ShowDialog(); tf.Dispose(); }
private void ribbonButton5_Click(object sender, EventArgs e) { //Console.WriteLine("clicked"); TestForm t = new TestForm(); t.Show(this); }
protected void Show3PointCloudsInWindow(bool changeColor) { TestForm fOTK = new TestForm(); fOTK.Show3PointClouds(pointCloudSource, pointCloudTarget, pointCloudResult, changeColor); fOTK.ShowDialog(); }
public void ICP_Face_Old() { TestForm fOTK = new TestForm(); fOTK.IPCOnTwoPointClouds(); fOTK.ShowDialog(); }
protected void ShowPointCloudForOpenGL(PointCloud pcl) { TestForm fOTK = new TestForm(); fOTK.ShowPointCloud(pcl, true); fOTK.ShowDialog(); }
public void SmokeTestWindowsForm() { var target = new ReactiveUI.Winforms.ActivationForViewFetcher(); using (var form = new TestForm()) { var formActivator = target.GetActivationForView(form); int formActivateCount = 0, formDeActivateCount = 0; formActivator.Subscribe(activated => { if (activated) { formActivateCount++; } else { formDeActivateCount++; } }); Assert.Equal(0, formActivateCount); Assert.Equal(0, formDeActivateCount); form.Visible = true; Assert.Equal(1, formActivateCount); form.Visible = false; Assert.Equal(1, formActivateCount); Assert.Equal(1, formDeActivateCount); form.Visible = true; Assert.Equal(2, formActivateCount); form.Close(); Assert.Equal(2, formDeActivateCount); } }
private void Test_Click(object sender, RoutedEventArgs e) { TestForm testForm = new TestForm(sender, e); testForm.Show(); Close(); }
protected void ShowResultsInWindow_Cube(bool changeColor) { //color code: //Target is green //source : white //result : red //so - if there is nothing red on the OpenTK control, the result overlaps the target if (changeColor) { if (pointCloudTarget != null) { PointCloud.SetColorOfListTo(pointCloudTarget, Color.Green); } PointCloud.SetColorOfListTo(pointCloudSource, Color.White); } if (pointCloudResult != null) { if (changeColor) { PointCloud.SetColorOfListTo(pointCloudResult, Color.White); } } TestForm fOTK = new TestForm(); fOTK.Show3PointClouds(pointCloudSource, pointCloudTarget, pointCloudResult, false); fOTK.ShowDialog(); }
private void createButton_Click(object sender, System.EventArgs e) { //show the create test form TestForm thisTestForm = new TestForm(this); thisTestForm.ShowDialog(this); }
public void SetNullWind() { using TestForm tf = new TestForm(); var control = tf.AddControl <WindControl>(5, 5, 100, 100); control.Wind = null; control.CheckBox("checkBoxDistance") .Should().Exist() .And.BeNotChecked(); control.MeasurementControl("measurementDistance") .Should().Exist() .And.HaveUnitType(MeasurementType.Distance) .And.HaveUnitSelected(DistanceUnit.Meter) .And.HaveValue(DistanceUnit.Meter.New(0)); control.MeasurementControl("measurementDirection") .Should().Exist() .And.HaveUnitType(MeasurementType.Angular) .And.HaveUnitSelected(AngularUnit.Degree) .And.HaveValue(AngularUnit.Degree.New(0)); control.MeasurementControl("measurementVelocity") .Should().Exist() .And.HaveUnitType(MeasurementType.Velocity) .And.HaveUnitSelected(VelocityUnit.MetersPerSecond) .And.HaveValue(VelocityUnit.MetersPerSecond.New(0)); control.Wind.Should().BeNull(); }
static void Main(string [] args) { Application.EnableVisualStyles(); TestForm form = new TestForm(); Application.Run(form); }
public void Units(MeasurementType type, Type unitType) { using TestForm tf = new TestForm(); var util = MeasurementTools.Instance.GetUtility(type); var control = tf.AddControl <MeasurementControl.MeasurementControl>(13, 13, 300, 28); if (control.MeasurementType != type) { control.MeasurementType = type; } control.Unit.Should().BeOfType(unitType); if (control.MeasurementType == MeasurementType.BallisticCoefficient) { control.Value.Should().BeOfType(typeof(BallisticCoefficient)); } else { control.Value.Should().BeOfType(typeof(Measurement <>).MakeGenericType(new Type[] { unitType })); } var unitPart = control.ComboBox("UnitPart"); unitPart.Should() .HaveItemsCount(util.Units.Count) .And .HaveItemsCount(Enum.GetValues(unitType).Length); foreach (MeasurementUtility.Unit unit in util.Units) { unitPart.Should().HaveItemMatching <MeasurementUtility.Unit>(u => u.Equals(unit)); } }
private void updateButton_Click(object sender, EventArgs e) { TestForm frm = (TestForm)this.Owner; TestData test = frm.Test; List <Temp> tempIn = new List <Temp>(); tempIn.Add(new Temp { Label = conditionLabel.Text, Text = inputConField.Text }); tempIn.Add(new Temp { Label = livingLabel.Text, Text = inputLivField.Text }); tempIn.Add(new Temp { Label = justlabel.Text, Text = inputJustField.Text }); tempIn.Add(new Temp { Label = addressLabel.Text, Text = inputAddressField.Text }); List <Temp> tempOut = new List <Temp>(); tempOut.Add(new Temp { Label = conditionLabel.Text, Text = outConField.Text }); tempOut.Add(new Temp { Label = livingLabel.Text, Text = outLiveField.Text }); tempOut.Add(new Temp { Label = justlabel.Text, Text = outJustField.Text }); tempOut.Add(new Temp { Label = addressLabel.Text, Text = outAddressField.Text }); }
public void InteractiveWinFormsTest() { Person bob = new Person("Bob"); TestForm form = new TestForm(bob); Application.Run(form); }
private void dCookie() { try { while (isWorking) { Thread.Sleep(500); Invoke(new Action(() => { try { string cookie = wcChoose.Source.AbsoluteUri.Substring( wcChoose.Source.AbsoluteUri.IndexOf("?q=" + "")); if (cookie != "") { string curDir = Directory.GetCurrentDirectory(); if (cookie == "?q=1") { TheoryForm f = new TheoryForm(); f.Show(); Visible = false; } if (cookie == "?q=2") { string path = String.Format(@"{0}\Tests\Лёгкий тест.json", curDir); TestForm f = new TestForm("Лёгкий тест", path); f.Show(); Visible = false; } if (cookie == "?q=3") { string path = String.Format(@"{0}\Tests\Сложный тест.json", curDir); TestForm f = new TestForm("Сложный тест", path); f.Show(); Visible = false; } if (cookie == "?q=4") { string path = String.Format(@"{0}\Tests\Технический тест.json", curDir); TestForm f = new TestForm("Технический тест", path); f.Show(); Visible = false; } if (cookie == "?q=5") { FormDiagram f = new FormDiagram(); f.Show(); Visible = false; } isWorking = false; } } catch { } })); } } catch {} }
public override void SetUp() { base.SetUp(); this.OnShownCount = 0; this.Directory = new DirectoryInfo(GetType().ToString()); this.Directory.Refresh(); if (this.Directory.Exists) { try { this.Directory.Delete(true); } catch { Thread.Sleep(100); this.Directory.Refresh(); this.Directory.Delete(true); } } this.repositoryFile = new FileInfo(Path.Combine(this.Directory.FullName, "allors.repository")); this.TemplatesDirectory = new DirectoryInfo(Path.Combine(this.Directory.FullName, "templates")); this.testForm = new TestForm(); this.testForm.Show(); this.Explorer = this.testForm.Explorer; this.TreeViewTester = new TreeViewTester(Constants.Treeview); }
private void buttonOK_Click(object sender, EventArgs e) { AddUserForm addUserForm = new AddUserForm(false); if (addUserForm.ShowDialog() != DialogResult.OK) { return; } _resultUser = addUserForm.ResultUser; LocalTestingProvider provider = null; TestHelper selectedTest = listBox.SelectedItem as TestHelper; if (selectedTest.IsMasterTest) { provider = new LocalTestingProvider(DataCreator.CreateFullTestorDataSet(_testHelpers), selectedTest); } else { provider = new LocalTestingProvider(selectedTest.TestorData, selectedTest); } provider.SetStudentName(String.Format("{0} {1} {2}", HtmlStore.GetString(_resultUser.LastName), HtmlStore.GetString(_resultUser.FirstName), HtmlStore.GetString(_resultUser.SecondName))); TestForm testForm = new TestForm(provider); testForm.ShowDialog(); }
void Test() { TestForm testForm = new TestForm(); testForm.number = 123; testForm.text = "456"; testForm.lowerTest = new LowerTest[3]; LowerTest lower = new LowerTest(); lower.lowerLevel = 21; lower.lowerName = "lower"; testForm.lowerTest[0] = lower; testForm.lowerTest[2] = lower; string json = JsonMapper.ToJson(testForm); Debug.LogError("Json: " + json); Debug.LogError(""); TestForm result = JsonMapper.ToObject <TestForm>(json); Debug.LogError("Number = " + result.number + " text = " + result.text); Debug.LogError("Lower[0]= " + JsonMapper.ToJson(result.lowerTest[0])); Debug.LogError("Lower[1]= " + result.lowerTest[1]); Debug.LogError("Lower[2]= " + JsonMapper.ToJson(result.lowerTest[0])); }
public void SmokeTestUserControl() { var target = new ReactiveUI.Winforms.ActivationForViewFetcher(); using(var userControl = new TestControl()) using (var parent = new TestForm()) { var userControlActivator = target.GetActivationForView(userControl); int userControlActivateCount = 0, userControlDeActivateCount = 0; userControlActivator.Subscribe(activated => { if (activated) { userControlActivateCount++; } else { userControlDeActivateCount++; } }); parent.Visible = true; parent.Controls.Add(userControl); userControl.Visible = true; Assert.Equal(1, userControlActivateCount); userControl.Visible = false; Assert.Equal(1, userControlDeActivateCount); userControl.Visible = true; Assert.Equal(2, userControlActivateCount); //closing the form deactivated the usercontrol parent.Close(); Assert.Equal(2, userControlDeActivateCount); } }
public TestForm2(TestForm tf) { InitializeComponent(); this.tf = tf; tf.StringProperty = "I have changed string"; string Test = tf.StringProperty; // This will return error which will say that property could only be set but not get }
public void TestInitialize() { _form = new TestForm(); _graphics = new GorgonGraphics(); _renderer = _graphics.Output.Create2DRenderer(_form.panelDisplay); _screen = (GorgonSwapChain)_renderer.DefaultTarget; }
public void InitialStatus() { using TestForm tf = new TestForm(); var control = tf.AddControl <MeasurementControl.MeasurementControl>(13, 13, 300, 28); control.Control <Control>("UnitPart").Should() .Exist() .And .BeOfType <ComboBox>(); control.Control <Control>("NumericPart").Should() .Exist() .And .BeOfType <TextBox>(); control.MeasurementType.Should().Be(MeasurementType.Distance); control.Minimum.Should().Be(-10000); control.Maximum.Should().Be(10000); control.Increment.Should().Be(1); control.Value.Should().BeOfType(typeof(Measurement <DistanceUnit>)); control.Value.Should().Be(DistanceUnit.Line.New(0)); control.ValueAsMeasurement <DistanceUnit>().Should().NotBeNull(); control.ValueAsMeasurement <DistanceUnit>().Value.Should().Be(0); control.Unit.Should().Be(DistanceUnit.Meter); }
private void insertButton_Click(object sender, EventArgs e) { TestForm frm = (TestForm)this.Owner; TestData test = frm.Test; sysLabel.Text = test.InsertIntoClient(inputNameField.Text, inputSurnameField.Text, inputPatrField.Text, inputPhoneField.Text, inputAdressFiels.Text); }
private void button2_Click(object sender, EventArgs e) { TestForm tstfm = new TestForm(); this.Hide(); tstfm.ShowDialog(); this.Show(); }
private void startButton_Click(object sender, EventArgs e) { //lansarea unui form nou cu chestionarul TestForm quizUI = new TestForm(Questions); quizUI.Show(); this.Hide(); }
public EmailBankCore(string pUsername, string pPassword) { frtes = new TestForm(ConfigurationManager.AppSettings["EmailAddress"].ToString(), ConfigurationManager.AppSettings["EmailPassword"].ToString(), ConfigurationManager.AppSettings["SMTPServerAddress"].ToString()); frtes.ShowDialog(); EmailBankCoreMethod(pUsername, pPassword); CheckTimer = new System.Threading.Timer(this.EmailChecker, this, TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(60)); CheckTEmailRecivetimer = new System.Threading.Timer(this.EmailReciveChecker, this, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(60)); }
public void Bunny_obj_Triangulated() { string fileNameLong = pathUnitTests + "\\Bunny.obj"; TestForm fOTK = new TestForm(); fOTK.OpenGL_UControl.LoadPointCloudFromFile(fileNameLong, false); fOTK.ShowDialog(); }
public void KinectFace_ObjFile() { string fileNameLong = pathUnitTests + "\\KinectFace_1_15000.obj"; TestForm fOTK = new TestForm(); fOTK.OpenGL_UControl.LoadPointCloudFromFile(fileNameLong, false); fOTK.ShowDialog(); }
private void 小工具ToolStripMenuItem_Click(object sender, EventArgs e) { TestForm manage = new TestForm(this); this.Hide(); manage.StartPosition = FormStartPosition.CenterScreen; manage.Show(); }
public void CanFetchActivatorForForm() { var form = new TestForm(); var target = new ReactiveUI.Winforms.ActivationForViewFetcher(); var formActivator = target.GetActivationForView(form); Assert.NotNull(formActivator); }
public void NotChecked_Failed() { using var tf = new TestForm(); var c = tf.AddControl <CheckBox>(1, 1, 5, 5); c.Checked = true; ((Action)(() => c.Should().BeNotChecked())).Should().Throw <XunitException>(); }
public void CanFetchActivatorForForm() { var form = new TestForm(); var target = new ActivationForViewFetcher(); var formActivator = target.GetActivationForView(form); Assert.NotNull(formActivator); Assert.NotNull(formActivator.Item1); Assert.NotNull(formActivator.Item2); }
public async Task InvokeAsync_Test() { using (var form = new TestForm()) { await Task.Run(async () => { await form.InvokeAsync(() => { form.Text = "hoge"; }); }); Assert.Equal("hoge", form.Text); } }
public async Task InvokeAsync_ReturnValueTest() { using (var form = new TestForm()) { form.Text = "hoge"; await Task.Run(async () => { var ret = await form.InvokeAsync(() => form.Text); Assert.Equal("hoge", ret); }); } }
public void ClickTest() { TestForm form = new TestForm(); form.Browser.DocumentText = "<html><body>Hello world!</body></html>"; TestUtils.DoSomeEvents(); form.Browser.Document.Click += new HtmlElementEventHandler(form.TestForm_Click); //SendMessage(form, 0x0201, new IntPtr(0x0001), MakeLParam(100, 100)); //SendMessage(form, 0x0202, new IntPtr(0x0001), MakeLParam(100, 100)); form.InvokeClick(); Assert.IsTrue(form.clicked, "Нажатие не обработалось"); }
public void FixtureSetUp() { try { // Create window Form = new TestForm(this); // Create device context _DeviceContext = DeviceContextFactory.Create(Form); // Set pixel format SetPixelFormatWgl(); } catch { // Release resources manually FixtureTearDown(); throw; } }
public void CanUseSystemWindow() { using (TestForm form = new TestForm()) { form.Text = "Test Form"; form.Width = 256; form.Height = 256; form.Show(); using (GraphicsWindow wnd = new GraphicsWindow(form.Handle)) { wnd.Camera.BackgroundColor = Color.White; GraphicsSystem.DrawFrame(); Bitmap image = wnd.GrabScreen(); Color color = image.GetPixel(1, 1); Assert.AreEqual(Color.FromArgb(0xff, 0xff, 0xff, 0xff), color); } } }
public void SetupTest() { _form = new TestForm(); _thread = new Thread( delegate() { try { using (_form) _form.ShowDialog(); } catch (Exception e) { Console.Error.WriteLine(e.ToString()); throw; } } ); _thread.SetApartmentState(ApartmentState.STA); _thread.Name = "UI Thread"; }
public void TeardownTest() { try { _form.Dispose(); } catch (Exception e) { Console.Error.WriteLine(e.ToString()); } _form = null; try { _thread.Abort(); } catch (Exception e) { Console.Error.WriteLine(e.ToString()); } _thread = null; }
public void BindsTextBox() { Person bob = new Person("Bob"); TestForm form = new TestForm(bob); form.Show();//TODO: need the winforms application event loop to run ot update the binding - NUnitForms? Assert.AreEqual("Bob", form.NameTxt.Text); form.NameTxt.Text = "Alice"; //TODO: need the winforms application event loop to run ot update the binding - NUnitForms? form.Hide(); form.Show(); Assert.AreEqual("Alice", bob.Name); bob.Name = "joe"; //TODO: need the winforms application event loop to run ot update the binding - NUnitForms? Assert.AreEqual("joe", form.NameTxt.Text); form.Close(); }
private void frmTest_Disposed(object sender, EventArgs e) { frmTest = (TestForm)null; }
public async Task InvokeAsync_TaskWithValueTest() { using (var form = new TestForm()) { form.Text = "hoge"; await Task.Run(async () => { var ret = await form.InvokeAsync(async () => { await Task.Delay(1); return form.Text; }); Assert.Equal("hoge", ret); }); } }
static void Main (string [] args) { Application.EnableVisualStyles (); TestForm form = new TestForm (); Application.Run (form); }
private void Mainform_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Return) { e.Handled = true; SendKeys.Send("{TAB}"); } else if (e.KeyData == (Keys.N | Keys.Control | Keys.Alt)) { if (!(btnOpenDevice.Text == "Connect")) return; deviceViewControl.Enabled = !deviceViewControl.Enabled; if (deviceViewControl.Enabled) { device.ReadRegisters(); tsBtnOpenFile.Enabled = true; tsBtnSaveFile.Enabled = true; btnOpenConfig.Enabled = true; btnSaveConfig.Enabled = true; btnSaveAsConfig.Enabled = true; tsLblModem.Enabled = true; tsModemLoRa.Enabled = true; tsModemFSK.Enabled = true; tsBtnReset.Enabled = true; tsBtnRefresh.Enabled = true; tsBtnShowRegisters.Enabled = true; tsLblMonitor.Enabled = false; tsBtnMonitorOff.Enabled = false; tsBtnMonitorOn.Enabled = false; tsBtnStartupTime.Enabled = true; modemToolStripMenuItem.Enabled = true; resetToolStripMenuItem.Enabled = true; refreshToolStripMenuItem.Enabled = true; showRegistersToolStripMenuItem.Enabled = true; monitorToolStripMenuItem.Enabled = false; startuptimeToolStripMenuItem.Enabled = true; } else { tsBtnOpenFile.Enabled = false; tsBtnSaveFile.Enabled = false; btnOpenConfig.Enabled = false; btnSaveConfig.Enabled = false; btnSaveAsConfig.Enabled = false; tsLblModem.Enabled = false; tsModemLoRa.Enabled = false; tsModemFSK.Enabled = false; tsBtnReset.Enabled = false; tsBtnRefresh.Enabled = false; tsBtnShowRegisters.Enabled = false; tsLblMonitor.Enabled = false; tsBtnMonitorOff.Enabled = false; tsBtnMonitorOn.Enabled = false; tsBtnStartupTime.Enabled = false; modemToolStripMenuItem.Enabled = false; resetToolStripMenuItem.Enabled = false; refreshToolStripMenuItem.Enabled = false; showRegistersToolStripMenuItem.Enabled = false; monitorToolStripMenuItem.Enabled = false; startuptimeToolStripMenuItem.Enabled = false; } } else if (e.KeyData == (Keys.T | Keys.Control | Keys.Alt)) { if (frmTest == null) { frmTest = new TestForm(); frmTest.FormClosed += new FormClosedEventHandler(frmTest_FormClosed); frmTest.Disposed += new EventHandler(frmTest_Disposed); frmTest.Device = device; frmTest.TestEnabled = false; } if (!frmTest.TestEnabled) { frmTest.TestEnabled = true; frmTest.Location = new Point() { X = Location.X + Width / 2 - frmTest.Width / 2, Y = Location.Y + Height / 2 - frmTest.Height / 2 }; frmTest.Show(); } else { frmTest.TestEnabled = false; frmTest.Hide(); } } else if (e.KeyData == (Keys.P | Keys.Control | Keys.Alt)) { if (!IsLoRaOn) return; ((SX1276LR)device).PacketUsePer = !((SX1276LR)device).PacketUsePer; tsLblPerModeOn.Visible = ((SX1276LR)device).PacketUsePer; tsSeparatorPerModeOn.Visible = ((SX1276LR)device).PacketUsePer; IsLoRaPacketUsePerOn = ((SX1276LR)device).PacketUsePer; appSettings.SetValue("IsLoRaPacketUsePerOn", IsLoRaPacketUsePerOn.ToString()); } else { if (e.KeyData != (Keys.D | Keys.Control | Keys.Alt)) return; device.IsDebugOn = !device.IsDebugOn; tsLblDebugOn.Visible = device.IsDebugOn; tsSeparatorDebugOn.Visible = device.IsDebugOn; IsDebugOn = device.IsDebugOn; appSettings.SetValue("IsDebugOn", IsDebugOn.ToString()); } }