コード例 #1
0
        public void CardAttributesConverterTestInputShouldNotBeNull()
        {
            //Assign
            Exception ex = null;

            //Act
            try
            {
                var attributes = new CardAttributesConverter(null);
            }
            catch (Exception e)
            {
                ex = e;
            }
            //Assert
            Assert.IsNotNull(ex);
        }
コード例 #2
0
        public void CardAttributesConverterTestPropertiesShouldBeConverted()
        {
            //Assign
            string fakeString = "fakeName,fakeSuit";

            string[] fakeValue         = { "fakeName", "fakeSuit" };
            var      mockConfiguration = new Mock <ILanguageDataProvider>();

            mockConfiguration.Setup(x => x.GetTextFromConfiguration(It.IsAny <string>()))
            .Returns(fakeString);

            //Act
            var attributes = new CardAttributesConverter(mockConfiguration.Object);
            var names      = attributes.Names;
            var suits      = attributes.Suits;

            //Assert
            Assert.AreEqual(fakeValue.GetLength(0), names.GetLength(0));
            Assert.AreEqual(fakeValue.GetLength(0), suits.GetLength(0));
        }