public void SwipeCard_WithValidBorrowerId_ExistingLoansDisplayed( IScanBookController scanBookController , IBorrowController borrowController , IBorrowingViewModel borrowingViewModel , ICardReaderController cardReaderController , ICardReaderViewModel cardReaderViewModel , IScanBookViewModel scanBookViewModel , IScannerController scannerController , IScannerViewModel scannerViewModel) { PreConditions(borrowController, cardReaderViewModel); // Arrange - User with existing loans. const string borrowerId = "2"; cardReaderViewModel.BorrowerId = borrowerId; // Act - Swipe the card. cardReaderController.CardSwiped(borrowerId); // Assert - ensure that the card reader is disabled. scanBookViewModel.ExistingLoan.Should().Contain("author1"); scanBookViewModel.ExistingLoan.Should().Contain("title2 "); scanBookViewModel.ExistingLoan.Should().Contain("fName2 lName2"); scanBookViewModel.ExistingLoan.Should().Contain(DateTime.Today.ToShortDateString()); scanBookViewModel.ExistingLoan.Should().Contain(DateTime.Today.AddDays(14).ToShortDateString()); }
public ScannerView(IScannerViewModel viewModel) { InitializeComponent(); Show(); }
public void SwipeCard_WithValidBorrowerId_ScannerIsEnabled( IScanBookController scanBookController , IBorrowController borrowController , ICardReaderController cardReaderController , ICardReaderViewModel cardReaderViewModel , IScanBookViewModel scanBookViewModel , IScannerController scannerController , IScannerViewModel scannerViewModel) { PreConditions(borrowController, cardReaderViewModel); // Arrange - unrestricted user. const string borrowerId = "1"; cardReaderViewModel.BorrowerId = borrowerId; // Act - Swipe the card. cardReaderController.CardSwiped(borrowerId); // Assert - ensure that the card reader is disabled. scannerViewModel.Enabled.Should().BeTrue(); }