Пример #1
0
        public void TestGetCardByEmptyType()
        {
            // Arrange
            Mock <ILoggingAdapter <CardRetrievalService> > myLogger = new Mock <ILoggingAdapter <CardRetrievalService> >();

            myLogger.Setup(logger => logger.LogInformation(It.IsAny <string>())).Verifiable();
            // Act
            CardRetrievalService myCardService = new CardRetrievalService(myLogger.Object);
            List <ArtifactCard>  cards         = myCardService.GetCardsByType("");

            // Assert
            Assert.IsNull(cards);
        }
Пример #2
0
        public void TestGetCardByInvalidType()
        {
            // Arrange
            Mock <ILoggingAdapter <CardRetrievalService> > myLogger = new Mock <ILoggingAdapter <CardRetrievalService> >();

            myLogger.Setup(logger => logger.LogInformation(It.IsAny <string>())).Verifiable();
            // Act
            CardRetrievalService myCardService = new CardRetrievalService(myLogger.Object);
            List <ArtifactCard>  cards         = myCardService.GetCardsByType("oishdfkljhwkejrhkjwhegbjh4e");

            // Assert
            // The list should be empty, but not null
            Assert.IsNotNull(cards);
            Assert.IsTrue(cards.Count == 0);
        }