Пример #1
0
        public void ArraysTest()
        {
            Doctor d = new Doctor("std");
            d.DoctorPrototype.AddPatients_Person = (self, p) => { };
            d.AddPatients(d);
            Assert.That(d.Patients, Is.Empty);

            bool wasCalled = false;
            d.DoctorPrototype.AddPatients_PersonArray = (self, ps) =>
                                                            {
                                                                self.xAddPatients(ps);
                                                                wasCalled = true;
                                                            };
            d.AddPatients(new[] {d});
            Assert.That(wasCalled);
        }
Пример #2
0
        public void PrivateCtorTest()
        {
            Civilian.StaticPrototype.Ctor = self => self.xName = "ABC";
            var civilian = new Civilian();

            Assert.That(civilian.Name, Is.EqualTo("ABC"));

            Assert.That(new Doctor("Brain").Specialization, Is.EqualTo("Brain"));

            Doctor doctor = new Doctor();
            Assert.That(doctor.Specialization, Is.Null);
        }