1 write to _dateTimePicker
System.Windows.Forms.Tests (1)
System\Windows\Forms\DateTimePickerTests.cs (1)
16public DateTimePickerTests() => _dateTimePicker = new();
97 references to _dateTimePicker
System.Windows.Forms.Tests (97)
System\Windows\Forms\DateTimePickerTests.cs (97)
18public 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); 374DateTime initialMaxDate = _dateTimePicker.MaxDate; 375_dateTimePicker.MaxDate = initialMaxDate; 376_dateTimePicker.MaxDate.Should().Be(initialMaxDate); 384Action 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); 412Action act = () => _dateTimePicker.MinDate = DateTimePicker.MaximumDateTime.AddDays(1); 415act = () => _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); 507Action act = () => _dateTimePicker.Value = DateTime.Parse(value); 517sender.Should().Be(_dateTimePicker); 522_dateTimePicker.FormatChanged += handler; 523_dateTimePicker.Format = DateTimePickerFormat.Short; 526_dateTimePicker.FormatChanged -= handler; 527_dateTimePicker.Format = DateTimePickerFormat.Long; 629sender.Should().Be(_dateTimePicker); 634_dateTimePicker.RightToLeftLayoutChanged += handler; 635_dateTimePicker.RightToLeftLayout = !_dateTimePicker.RightToLeftLayout; 638_dateTimePicker.RightToLeftLayoutChanged -= handler; 639_dateTimePicker.RightToLeftLayout = !_dateTimePicker.RightToLeftLayout; 649sender.Should().Be(_dateTimePicker); 654_dateTimePicker.ValueChanged += handler; 655_dateTimePicker.Value = DateTime.Now; 658_dateTimePicker.ValueChanged -= handler; 659_dateTimePicker.Value = DateTime.Now.AddDays(1);