Пример #1
0
        public void Save_IsInvoked_SaveAllChangesEventIsPublished()
        {
            bool saveAllChangesEventReceived          = false;
            Action <SaveAllChangesEvent> eventHandler = o => saveAllChangesEventReceived = true;

            _InitializeDependencies(eventHandler);

            // act
            var target = new ChangeTrackingService();

            target.Save();

            Assert.IsTrue(saveAllChangesEventReceived);
        }
Пример #2
0
        public void Save_IsInvokedWithFileName_SaveAllChangesEventIsPublishedWithFileName()
        {
            const string testFileName = "C:\\test.targets";

            bool saveAllChangesEventReceivedCorrectly = false;
            Action <SaveAllChangesEvent> eventHandler = o => saveAllChangesEventReceivedCorrectly = o.FileName == testFileName;

            _InitializeDependencies(eventHandler);

            // act
            var target = new ChangeTrackingService();

            target.Save(testFileName);

            Assert.IsTrue(saveAllChangesEventReceivedCorrectly);
        }