public void GetCode_ShouldReturnCardCode_WhenEasyCard()
        {
            // Arrange
            var card     = new Card(Suit.Diamonds, Rank.Four);
            var expected = "4D";
            // Act
            var cardCode = _sut.GetCode(card);

            // Assert
            cardCode.Should().BeEquivalentTo(expected);
        }
Exemplo n.º 2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var projectPath = Directory.GetParent(Environment.CurrentDirectory).Parent.Parent.FullName;
            var cardCode    = _cardCodeService.GetCode((Card)value);
            var fileName    = $"{projectPath}\\Resources\\Cards\\{cardCode}.png";

            return(new ImageSourceConverter().ConvertFrom(fileName));
        }