1 write to _dateTimePicker
System.Windows.Forms.Tests (1)
System\Windows\Forms\DateTimePickerTests.cs (1)
16
public DateTimePickerTests() =>
_dateTimePicker
= new();
97 references to _dateTimePicker
System.Windows.Forms.Tests (97)
System\Windows\Forms\DateTimePickerTests.cs (97)
18
public void Dispose() =>
_dateTimePicker
.Dispose();
286
_dateTimePicker
.CalendarFont = expectedFont;
287
_dateTimePicker
.CalendarFont.Should().Be(expectedFont);
292
_dateTimePicker
.CalendarFont = differentFont;
293
_dateTimePicker
.CalendarFont.Should().Be(differentFont);
296
_dateTimePicker
.CalendarFont = null;
297
_dateTimePicker
.CalendarFont.Should().Be(
_dateTimePicker
.Font);
303
_dateTimePicker
.ShowCheckBox = true;
304
_dateTimePicker
.CreateControl();
306
_dateTimePicker
.Checked = true;
307
_dateTimePicker
.Checked.Should().BeTrue();
309
_dateTimePicker
.Checked = false;
310
_dateTimePicker
.Checked.Should().BeFalse();
312
_dateTimePicker
.Checked = true;
313
_dateTimePicker
.Checked.Should().BeTrue();
321
_dateTimePicker
.ShowCheckBox = value;
323
_dateTimePicker
.Checked = true;
324
_dateTimePicker
.Checked.Should().BeTrue();
326
_dateTimePicker
.Checked = false;
327
_dateTimePicker
.Checked.Should().BeFalse();
333
_dateTimePicker
.CustomFormat.Should().BeNull();
335
_dateTimePicker
.Value = new(2021, 12, 31);
336
_dateTimePicker
.CreateControl();
337
_dateTimePicker
.Format = DateTimePickerFormat.Custom;
340
_dateTimePicker
.CustomFormat = newCustomFormat;
341
_dateTimePicker
.CustomFormat.Should().Be(newCustomFormat);
342
_dateTimePicker
.Text.Should().Be("2021/12/31");
345
_dateTimePicker
.CustomFormat = newCustomFormat2;
346
_dateTimePicker
.CustomFormat.Should().Be(newCustomFormat2);
347
_dateTimePicker
.Text.Should().Be("12/31/2021");
349
_dateTimePicker
.CustomFormat = null;
350
_dateTimePicker
.CustomFormat.Should().BeNull();
356
_dateTimePicker
.DropDownAlign.Should().Be(LeftRightAlignment.Left);
358
_dateTimePicker
.DropDownAlign = LeftRightAlignment.Right;
359
_dateTimePicker
.DropDownAlign.Should().Be(LeftRightAlignment.Right);
361
_dateTimePicker
.DropDownAlign = LeftRightAlignment.Left;
362
_dateTimePicker
.DropDownAlign.Should().Be(LeftRightAlignment.Left);
368
_dateTimePicker
.MaxDate.ToString().Should().Be("12/31/9998 12:00:00 AM");
371
_dateTimePicker
.MaxDate = expectedDate;
372
_dateTimePicker
.MaxDate.Should().Be(expectedDate);
374
DateTime initialMaxDate =
_dateTimePicker
.MaxDate;
375
_dateTimePicker
.MaxDate = initialMaxDate;
376
_dateTimePicker
.MaxDate.Should().Be(initialMaxDate);
384
Action act = () =>
_dateTimePicker
.MaxDate = DateTime.Parse(value);
402
_dateTimePicker
.MinDate.ToString().Should().Be("1/1/1753 12:00:00 AM");
405
_dateTimePicker
.MinDate = expectedDate;
406
_dateTimePicker
.MinDate.Should().Be(expectedDate);
412
Action act = () =>
_dateTimePicker
.MinDate = DateTimePicker.MaximumDateTime.AddDays(1);
415
act = () =>
_dateTimePicker
.MinDate = DateTimePicker.MinimumDateTime.AddDays(-1);
422
_dateTimePicker
.Value = DateTimePicker.MinimumDateTime.AddDays(5);
424
_dateTimePicker
.MinDate = newMinDate;
426
_dateTimePicker
.MinDate.Should().Be(newMinDate);
427
_dateTimePicker
.Value.Should().Be(newMinDate);
446
_dateTimePicker
.RightToLeftLayout.Should().Be(false);
448
_dateTimePicker
.RightToLeftLayout = true;
449
_dateTimePicker
.RightToLeftLayout.Should().Be(true);
451
_dateTimePicker
.RightToLeftLayout = false;
452
_dateTimePicker
.RightToLeftLayout.Should().Be(false);
458
_dateTimePicker
.ShowUpDown.Should().Be(false);
460
_dateTimePicker
.ShowUpDown = true;
461
_dateTimePicker
.ShowUpDown.Should().Be(true);
463
_dateTimePicker
.ShowUpDown = false;
464
_dateTimePicker
.ShowUpDown.Should().Be(false);
471
_dateTimePicker
.CreateControl();
473
_dateTimePicker
.Text = validDateString;
474
_dateTimePicker
.Text.Should().Be(DateTime.Parse(validDateString, CultureInfo.CurrentCulture).ToString("dddd, MMMM d, yyyy"));
476
_dateTimePicker
.Text = null;
477
_dateTimePicker
.Text.Should().Be(DateTime.Parse(DateTime.Now.Date.ToString(), CultureInfo.CurrentCulture).ToString("dddd, MMMM d, yyyy"));
479
_dateTimePicker
.Text = string.Empty;
480
_dateTimePicker
.Text.Should().Be(DateTime.Parse(DateTime.Now.Date.ToString(), CultureInfo.CurrentCulture).ToString("dddd, MMMM d, yyyy"));
489
_dateTimePicker
.Value = initialDate;
490
_dateTimePicker
.Value.Should().Be(initialDate);
492
_dateTimePicker
.Value = newDate;
493
_dateTimePicker
.Value.Should().Be(newDate);
495
_dateTimePicker
.Value = DateTimePicker.MinimumDateTime;
496
_dateTimePicker
.Value.Should().Be(DateTimePicker.MinimumDateTime);
498
_dateTimePicker
.Value = DateTimePicker.MaximumDateTime;
499
_dateTimePicker
.Value.Should().Be(DateTimePicker.MaximumDateTime);
507
Action act = () =>
_dateTimePicker
.Value = DateTime.Parse(value);
517
sender.Should().Be(
_dateTimePicker
);
522
_dateTimePicker
.FormatChanged += handler;
523
_dateTimePicker
.Format = DateTimePickerFormat.Short;
526
_dateTimePicker
.FormatChanged -= handler;
527
_dateTimePicker
.Format = DateTimePickerFormat.Long;
629
sender.Should().Be(
_dateTimePicker
);
634
_dateTimePicker
.RightToLeftLayoutChanged += handler;
635
_dateTimePicker
.RightToLeftLayout = !
_dateTimePicker
.RightToLeftLayout;
638
_dateTimePicker
.RightToLeftLayoutChanged -= handler;
639
_dateTimePicker
.RightToLeftLayout = !
_dateTimePicker
.RightToLeftLayout;
649
sender.Should().Be(
_dateTimePicker
);
654
_dateTimePicker
.ValueChanged += handler;
655
_dateTimePicker
.Value = DateTime.Now;
658
_dateTimePicker
.ValueChanged -= handler;
659
_dateTimePicker
.Value = DateTime.Now.AddDays(1);