Exemplo n.º 1
0
        public void InvalidYear()
        {
            var p = new Patient();

            e = new PatientEditorViewModel(p);

            e.Patient.BirthYear = DateTime.Today.Year + 1;

            Assert.IsTrue(!e.CanOk);
        }
Exemplo n.º 2
0
        public void SavePatient()
        {
            var p = new Patient();

            e = new PatientEditorViewModel(p);

            Assert.IsTrue(e.IsUnsaved);

            var name = "  qwe asd zxС hj";

            e.Patient.FullName = name;
            e.Patient.Age      = 10;
            e.Patient.IsFemale = true;

            Assert.AreEqual(10, p.Age);
            Assert.AreEqual(name.Trim(), p.FullNameOrCreatedAt);
            Assert.AreEqual(false, p.IsMale);
        }
Exemplo n.º 3
0
 public PatientEditorView( PatientEditorViewModel patientEditorViewModel )
     : this()
 {
     DataContext = patientEditorViewModel;
 }