コード例 #1
0
ファイル: RoomViewModel.cs プロジェクト: sixtythreebits/Cavea
        void UpdateSeatBindings(RoomSeat Seat)
        {
            SelectedItemsCount = Items.Sum(i => i.Seats.Count(s => s.IsSelected));
            Seat.Row.Refresh();

            RemoveBookingCommand.RaiseCanExecuteChanged();
            FreeBookingCommand.RaiseCanExecuteChanged();
            PaidBookingCommand.RaiseCanExecuteChanged();
        }
コード例 #2
0
        public void GivenCorrectId_WhenRemoveArticle_ShouldFinishSuccessfully()
        {
            // Arrange
            var LRemoveBookingCommand = new RemoveBookingCommand
            {
                Id = Guid.NewGuid()
            };

            // Act
            var LValidator = new RemoveBookingCommandValidator();
            var LResult    = LValidator.Validate(LRemoveBookingCommand);

            // Assert
            LResult.Errors.Should().BeEmpty();
        }
コード例 #3
0
        public void GivenIncorrectId_WhenRemoveArticle_ShouldThrowError()
        {
            // Arrange
            var LRemoveArticleCommand = new RemoveBookingCommand
            {
                Id = Guid.Empty
            };

            // Act
            var LValidator = new RemoveBookingCommandValidator();
            var LResult    = LValidator.Validate(LRemoveArticleCommand);

            // Assert
            LResult.Errors.Count.Should().Be(1);
            LResult.Errors[0].ErrorCode.Should().Be(nameof(ValidationCodes.REQUIRED));
        }
コード例 #4
0
ファイル: RoomViewModel.cs プロジェクト: sixtythreebits/Cavea
 void RowSelect(RoomRow row)
 {
     RemoveBookingCommand.RaiseCanExecuteChanged();
     FreeBookingCommand.RaiseCanExecuteChanged();
     PaidBookingCommand.RaiseCanExecuteChanged();
 }