Пример #1
0
        public void Should_Throw_When_CommandIsNull()
        {
            var settingsStore = Substitute.For <ISettingsStore>();

            var handler = new MoveUpCommandHandler(settingsStore);

            handler.Handle(null);
        }
Пример #2
0
        public void Should_MoveUp_And_Save()
        {
            var settingsStore = Substitute.For <ISettingsStore>();
            var item          = Substitute.For <Item>();
            var command       = new MoveUpCommand(item);
            var handler       = new MoveUpCommandHandler(settingsStore);

            handler.Handle(command);

            item.Received().MoveUp();

            settingsStore.Received().TrySave();
        }