public async Task OnGetProperty_CanRetrieveColor() { await Window.SetXamlContent(@"<Grid x:Name=""MyGrid"" Background=""Red"" />"); IVisualElement <Grid> element = await Window.GetElement <Grid>("MyGrid"); Assert.AreEqual(Colors.Red, await element.GetBackgroundColor()); }
public async Task OnGetProperty_CanRetrieveColor() { IWindow window = await App.CreateWindowWithContent( @"<Grid x:Name=""MyGrid"" Background=""Red"" />"); IVisualElement element = await window.GetElement("MyGrid"); Assert.AreEqual(Colors.Red, await element.GetBackgroundColor()); }
public async Task Mode_SetsThemeColors(ColorZoneMode mode, string backgroundBrush, string foregroundBrush) { await using var recorder = new TestRecorder(App); IVisualElement <ColorZone> colorZone = await LoadXaml <ColorZone>(@$ " <materialDesign:ColorZone Mode=" "{mode}" "/> "); Color background = await GetThemeColor(backgroundBrush); Color foreground = await GetThemeColor(foregroundBrush); Assert.Equal(background, await colorZone.GetBackgroundColor()); Assert.Equal(foreground, await colorZone.GetForegroundColor()); recorder.Success(); }
public async Task OnLoad_ThemeBrushesSet() { await using var recorder = new TestRecorder(App); //Arrange IVisualElement <Button> button = await LoadXaml <Button>(@"<Button Content=""Button"" />"); Color midColor = await GetThemeColor("PrimaryHueMidBrush"); //Act Color?color = await button.GetBackgroundColor(); //Assert Assert.Equal(midColor, color); recorder.Success(); }