public void RunTest() { ExampleEngine engine = new ExampleEngine(); var model = new ExampleModel() {Value1 = 1, Value2 = 2}; IList<IEngineResult> results = engine.Run(model); Assert.AreEqual(3,model.AddResult); }
public IActionResult Captcha(ExampleModel model) { MvcCaptcha.ResetCaptcha("ExampleCaptcha"); return(View(model)); }
protected override void When() { Result = SUT.VerifyResponse <ExampleModel>(restResponse); }
public IActionResult Post([FromBody] ExampleModel model) => Ok(model);
public ActionResult Index(ExampleModel exampleModel) { return(View(ViewPath)); }
public void Insert(ExampleModel model) { Table.Add(model.ID, model); }
// constructor public icon() { Test = new ExampleModel(); Test.ExampleString = "Hello World"; }
public async Task <int> UpdateExampleModelAsync(ExampleModel model) { return(await _repository.UpdateAsync(model)); }
public string ExamplePost([Bind("ExampleInt, ExampleString")] ExampleModel exampleModel) { return(exampleModel.ExampleString); }
public void Equals_returns_false_if_other_is_null() { ExampleModel other = null; _ = control.Equals(other).Should().Be(false); }
private void Window_Loaded(object sender, RoutedEventArgs e) { ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; System.Net.WebClient client = new System.Net.WebClient(); ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); }; string sHttpResonse = client.DownloadString("https://www.finam.ru/profile/moex-akcii/gazprom/export"); List <string> hrefTags = new List <string>(); var parser = new HtmlParser(); var document = parser.Parse(sHttpResonse); foreach (IElement element in document.QuerySelectorAll("div.content")) { string str = element.TextContent.Replace($"\t", "").Replace($"\n", ""); if (element.TextContent.Contains("Германии")) { hrefTags.Add('[' + str.Split('[', ']')[1] + ']'); } } List <MyArray> result = JsonConvert.DeserializeObject <List <MyArray> >(hrefTags[0]); if (String.IsNullOrEmpty(Properties.Settings.Default.PathSaveSetting)) { Properties.Settings.Default.PathSaveSetting = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\DtgdExample"; Properties.Settings.Default.Save(); } HistoryRowsDetails = new History <ExampleModel>(); HistoryColumnsDetails = new History <ColumnDetail>(); ExampleModelCollection = HistoryRowsDetails.LoadDetails(Properties.Settings.Default.PathSaveSetting, "\\RowsDetail.xml"); ColumnDetails = HistoryColumnsDetails.LoadDetails(Properties.Settings.Default.PathSaveSetting, "\\ColumnsDetail.xml"); if (ExampleModelCollection.Count == 0) { //в случае обычно привязки все довольно просто for (int i = 0; i < 10; i++) { ExampleModel model = new ExampleModel { Name = TypeStratetgyContanier + (i + 1), NumberRow = i + 1, ColorBackground = Colors.Aqua.ToString() }; model.AddColumn.Add(new DynamicColumnModel { Value = i * 4, Color = Colors.Red.ToString() }); ExampleModelCollection.Add(model); } } //правильно привязать ресурс к колонке добавленой из кода DtgdExample.ItemsSource = ExampleModelCollection; SetNewColumn(); foreach (var res in result) { tree.Items.Add(res.title); } if (ColumnDetails.Count != 0) { try { foreach (var column in DtgdExample.Columns) { var TargetRow = ColumnDetails.Where(x => x.NameColumn == column.Header.ToString()).FirstOrDefault(); if (TargetRow != null) { column.Visibility = TargetRow.IsShow == true ? System.Windows.Visibility.Visible : System.Windows.Visibility.Hidden; column.DisplayIndex = TargetRow.Number; } } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace, "Alert"); } } foreach (var column in DtgdExample.Columns) { var checkBox = new CheckBox(); checkBox.Content = column.Header.ToString(); checkBox.Checked += CheckBox_Checked; checkBox.Unchecked += CheckBox_Unchecked; dtgrdContextMenu.Items.Add(checkBox); } }
public bool UpdateItem(ExampleModel item) { throw new NotImplementedException(); }
public AndroidExampleModelWrapper(ExampleModel model) { Model = model; }
public ActionResult Index(ExampleModel model) { var test = model; return(View(model)); }
public string Test([FromForm] ExampleModel exampleModel) { return(exampleModel.ExampleString); }
protected bool ValidateModel(ExampleModel exampleModel) { //Data validation... return(true); }
static void Main(string[] args) { Console.WriteLine(ExampleModel.DownloadString()); Console.ReadKey(); }
public void Post([FromBody] ExampleModel prmExampleModel) { }
public ExampleModel AddExampleModelItem(ExampleModel item) { _exampleModelItems.Add(item.ItemName, item); return(item); }
public IActionResult PostExample(ExampleModel model) { return(RedirectToAction("Index", this.GetNoLayoutParams())); }
public IActionResult Create() { var data = new ExampleModel(); return(View(data)); }
public void Update(ExampleModel model) { Table[model.ID] = model; }
private static ExampleModel CloneExample(ExampleModel existingExample) { return((ExampleModel) new ExampleModel().InjectFrom(existingExample)); }
/// <exception cref="SwaggerException">A server side error occurred.</exception> public System.Threading.Tasks.Task <int> CreateAsync(ExampleModel record) { return(CreateAsync(record, System.Threading.CancellationToken.None)); }
/// <summary> /// Update /// </summary> /// <param name="data">The record passed in.</param> /// <returns>The updated record.</returns> public ExampleModel Update(ExampleModel data) { var myData = repository.Update(data); return(myData); }