Example #1
0
        public void GetFullPathTest_InalidSVGName(string svgName)
        {
            //Arrange

            //Act
            Assert.Throws <ArgumentException>(() => SvgService.GetResourcePath(svgName));

            //Assert
        }
Example #2
0
        public void GetResourcePathTest_InalidSVGName(string svgName)
        {
            //Arrange
            var expectedResourcePath = "GitTrends.Resources.SVGs." + svgName;

            //Act
            Assert.Throws <ArgumentException>(() => SvgService.GetResourcePath(svgName));

            //Assert
        }
Example #3
0
        public void GetFullPathTest_ValidSVGName()
        {
            //Arrange
            const string svgName = "star.svg";
            const string expectedResourcePath = "resource://GitTrends.Resources.SVGs." + svgName;

            //Act
            var actualResourcePath = SvgService.GetFullPath(svgName);

            //Assert
            Assert.AreEqual(expectedResourcePath, actualResourcePath);
        }
Example #4
0
        public void GetColorStringMap_InalidHex(string hex)
        {
            //Arrange
            var expectedColorMap = new Dictionary <string, string>
            {
                { "#000000", hex }
            };

            //Act
            Assert.Throws <ArgumentException>(() => SvgService.GetColorStringMap(hex));

            //Assert
        }
Example #5
0
        public void GetColorStringMap_ValidHex()
        {
            //Arrange
            const string hex = "#AABBCCFF";
            var          expectedColorMap = new Dictionary <string, string>
            {
                { "#000000", hex }
            };

            //Act
            var actualColorMap = SvgService.GetColorStringMap(hex);

            //Assert
            Assert.AreEqual(expectedColorMap, actualColorMap);
        }
        public async Task EnableNotificationsButtonTappedTest()
        {
            //Arrange
            const string successSvg = "check.svg";
            const string bellSvg    = "bell.svg";

            string notificationStatusSvgImageSource_Initial, notificationStatusSvgImageSource_Final;
            var    onboardingViewModel = ServiceCollection.ServiceProvider.GetRequiredService <OnboardingViewModel>();

            //Act
            notificationStatusSvgImageSource_Initial = onboardingViewModel.NotificationStatusSvgImageSource;

            await onboardingViewModel.EnableNotificationsButtonTapped.ExecuteAsync().ConfigureAwait(false);

            notificationStatusSvgImageSource_Final = onboardingViewModel.NotificationStatusSvgImageSource;

            //Assert
            Assert.AreEqual(SvgService.GetFullPath(bellSvg), notificationStatusSvgImageSource_Initial);
            Assert.AreEqual(SvgService.GetFullPath(successSvg), notificationStatusSvgImageSource_Final);
        }