Esempio n. 1
0
        public void TestThatCloneClonesDataRepository()
        {
            var oldToNewDataRepository = new OldToNewDataRepository(RepositoryTestHelper.GetSourcePathForTest());

            Assert.That(oldToNewDataRepository, Is.Not.Null);

            var clonedRepository = oldToNewDataRepository.Clone() as IDataRepository;

            Assert.That(clonedRepository, Is.Not.Null);
            Assert.That(clonedRepository, Is.Not.EqualTo(oldToNewDataRepository));
            Assert.That(clonedRepository, Is.TypeOf <OldToNewDataRepository>());
        }
Esempio n. 2
0
        public void TestThatCloneRaiseOnCloneEvent()
        {
            var oldToNewDataRepository = new OldToNewDataRepository(RepositoryTestHelper.GetSourcePathForTest());

            Assert.That(oldToNewDataRepository, Is.Not.Null);

            var eventCalled = false;

            oldToNewDataRepository.OnClone += (sender, eventArgs) =>
            {
                Assert.That(sender, Is.Not.Null);
                Assert.That(eventArgs, Is.Not.Null);
                Assert.That(eventArgs.ClonedDataRepository, Is.Not.Null);
                eventCalled = true;
            };

            Assert.That(eventCalled, Is.False);
            var clonedRepository = oldToNewDataRepository.Clone() as IDataRepository;

            Assert.That(clonedRepository, Is.Not.Null);
            Assert.That(eventCalled, Is.True);
        }