Skip to content

Commit

Permalink
v200.4.0 (#569)
Browse files Browse the repository at this point in the history
* Upgrade dependencies

* FeatureFormsView (#546)

FeatureFormView for WPF

* Rename property (#547)

* FeatureForm: localized messages (#548)

* Add better localizable error messages to form validation and handle null and invalid values better
* Prep multiple resources for UWP

* Add resource manifest

* Fix slashes

* Add context to resource strings to help with translations

* Undo key rename

* Prefix scaleline resource ids

* Replace FloorFilter strings with localizable strings

* Replace SearchView strings with localizable strings

* Add markup extension for localizing strings in XAML

* Fix typo

* Update maui target versions

* Adjust to breaking design changes in FeatureForms API

* utilnet: localize trace tool

* utilnet: default to empty instead of throw, remove unncessary catch

* utilnet: add catch-all to guard against UN failing to load

* utilnet: remove localized exception messages though they affect UI.

* Handle prop changed events to validation errors (#553)

Co-authored-by: Morten Nielsen <mort5161@esri.com>

* Handle events firing on background threads

* Add missing xmlns mapping for maui

* Handle UI Thread-access issue

* Update error messages on initial load

* Update strings to avoid pluralization issues

* Remove BarcodeScannerFormInput (#563)

* Hide unsupported inputs + remove unused code

* Handle visibility changes coming from background thread

* Update validation as you type

* Adds an analyzer that detects whether UseArcGISToolkit has been added (#556)

* Adds an analyzer that detects whether UseArcGISToolkit has been added

* FeatureForm WPF: Tooltip shows even when empty (#561)

* Adding Visibility toggle based on content of `Hint` Property using VisibilityConverter

* Changing Tooltip visibility code from ValueConverter to Triggers.

* Don't sign unpackable targets

Ensure only packable projects gets signed. If built with `GeneratePackageOnBuild=true` this command would run and fail.

* FeatureForms for .NET MAUI (#564)

* Initial skeleton for maui feature forms

* SwitchInput added

* Added text inputs

* Add error border to text fields

* Added place holders for remaining input types

* Implement combobox

* Add radio button support

* Clean up

* Update enable state

* Add group expander

* Maui: Update switch enable state

* Improve group UI

* Style fixes

* indent

* More styling tweaks

* Show 0 length for null strings

* Improve switch

* Add IsValid property to MAUI

* ui fixes

* Move guarded evaluate to FeatureFormView and also use it on initialize to avoid more cancellation exceptions

* Improve group rendering

* Improve group box UI

* Use TextBlock instead to show readonly text

+ Don't show error messages when a field isn't editable

* Use extension method for dispatching

* Rename files

* Use unicode

* Remove unused code

* Preserve property

* Missing preserves

* Fix type

* Add missing INT64

* Add FFV doc

* Update doc

* Include all language resources on MAUI and WinUI as well

* feat(localization): update pseudo translation (#557)

* Update translation - @mit10976 @Isa13169 @nia13404

* Add FeatureFormView sample

* MAUI: Add DateTimePickerFormInput (#565)

* wpf: Improve keyboard navigation for FeatureForms (#567)

* Use updated URLs

* Fix version

* Fix typo

---------

Co-authored-by: Morten Nielsen <mort5161@esri.com>
Co-authored-by: Matvei Stefarov <mstefarov@esri.com>
Co-authored-by: Jennifer Nery <jnery@esri.com>
Co-authored-by: Prathamesh Narkhede <55591622+prathameshnarkhede@users.noreply.github.com>
Co-authored-by: Isaac Sesmundo <isesmundo@esri.com>
  • Loading branch information
6 people authored Apr 11, 2024
1 parent 5a3260c commit fbea93f
Show file tree
Hide file tree
Showing 144 changed files with 21,840 additions and 213 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ src/Samples/Toolkit.SampleApp.Android/Resources/Resource.Designer.cs
src/Samples/Toolkit.Samples.Forms/Toolkit.Samples.Forms.UWP/BundleArtifacts
src/ProjectTemplates/.vs
src/Samples/Toolkit.SampleApp.WinUI/Samples
src/Toolkit/Toolkit.UWP/LocalizedStrings/en-US/Resources.resw
src/Toolkit/Toolkit.UWP/LocalizedStrings/*/Resources.resw
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The ArcGIS Maps SDK for .NET Toolkit contains controls and components to acceler
|[BookmarksView](docs/bookmarks-view.md) | ![image](https://user-images.githubusercontent.com/29742178/150397137-28029b87-5384-41b1-aabf-98260885152d.png) | Show and navigate to bookmarks from a map or a custom list. | WinUI, MAUI, UWP, WPF |
| [Compass](docs/compass.md) | ![compass](https://user-images.githubusercontent.com/1378165/73389839-d9c8f500-4289-11ea-923c-18232489b3e0.png) | Show a compass direction when the map or scene is rotated. | WinUI, MAUI, UWP, WPF |
| [FeatureDataField](docs/feature-data-field.md) | ![FeatureDataField](https://user-images.githubusercontent.com/1378165/73389879-ebaa9800-4289-11ea-8e4e-de153a6a371a.png) | Display and optionally allow editing of a single field attribute of a feature. | UWP, WPF |
|[FeatureFormView](docs/featureformview.md) | <img src="https://github.com/Esri/arcgis-maps-sdk-dotnet-toolkit/assets/1378165/db61facf-d45e-49ac-b1ac-9af55511cd6c" width="150" title="FeatureFormView" /> | Generates an interactive form. | MAUI, WPF |
|[FloorFilter](docs/floor-filter.md) | ![image](https://user-images.githubusercontent.com/29742178/158746908-71a39e28-596f-44b6-9230-e2a04bdaeb9e.png) | Browse floor-aware maps and scenes and filter the view to show levels in a facility. | WinUI, MAUI, UWP, WPF |
|[GeoViewController](docs/geoviewcontroller.md) | | A helper class to enable easy adoption of MVVM patterns in an ArcGIS Maps SDK for .NET application. | WinUI, MAUI, UWP, WPF |
| [Legend](docs/legend.md) | <img src="https://user-images.githubusercontent.com/1378165/73389924-011fc200-428a-11ea-91bf-4ea1c2bf6683.png" width="105" title="Legend" />| Display a legend for a map or scene view. | WinUI, MAUI, UWP, WPF |
Expand Down
2 changes: 1 addition & 1 deletion build/Signing.targets
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
WorkingDirectory="$(ProjectDir)" EchoOff="true" />
</Target>

<Target Name="SignNuGet" Condition="'$(SignNugetCommand)' != ''" AfterTargets="Pack" DependsOnTargets="DownloadNuGetExe">
<Target Name="SignNuGet" Condition="'$(SignNugetCommand)' != '' AND '$(IsPackable)'=='true'" AfterTargets="Pack" DependsOnTargets="DownloadNuGetExe">
<PropertyGroup>
<NugetPackageFileName>$(PackageOutputPath)\$(PackageId).$(PackageVersion).nupkg</NugetPackageFileName>
<SNugetPackageFileName>$(PackageOutputPath)\$(PackageId).$(PackageVersion).snupkg</SNugetPackageFileName>
Expand Down
2 changes: 2 additions & 0 deletions docs/concepts/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
href: ../overview-map.md
- name: Popup Viewer
href: ../popup-viewer.md
- name: Feature Form View
href: ../featureformview.md
- name: Scale Line
href: ../scale-line.md
- name: Search View
Expand Down
90 changes: 90 additions & 0 deletions docs/featureformview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# FeatureFormView

Generates an interactive form from a [FeatureFormDefinition](https://developers.arcgis.com/net/api-reference/api/netwin/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Mapping.FeatureForms.FeatureFormDefinition.html).

![image](https://github.com/Esri/arcgis-maps-sdk-dotnet-toolkit/assets/1378165/ff655fac-9eae-48ce-a044-588a2e32afa8)

## Features

- Supports interactive editing of Features through text, checkboxes, comboboxes, switches etc.

## Usage

FeatureFormView displays a feature from using an underlying [`FeatureForm`](https://developers.arcgis.com/net/api-reference/api/netwin/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Mapping.FeatureForms.FeatureForm.html).


The following code shows how to get a `Feature` and its `FeatureFormDefinition` from an identify result:

```cs
private ArcGISFeature? GetFeature(IEnumerable<IdentifyLayerResult> results, out FeatureFormDefinition? definition)
{
def = null;
if (results == null)
return null;
foreach (var result in results.Where(r => r.LayerContent is FeatureLayer layer && (layer.FeatureFormDefinition is not null || (layer.FeatureTable as ArcGISFeatureTable)?.FeatureFormDefinition is not null)))
{
var feature = result.GeoElements?.OfType<ArcGISFeature>()?.FirstOrDefault();
def = (result.LayerContent as FeatureLayer)?.FeatureFormDefinition ?? ((result.LayerContent as FeatureLayer)?.FeatureTable as ArcGISFeatureTable)?.FeatureFormDefinition;
if (feature != null && def != null)
{
return feature;
}
}

return null;
}
```

The following code shows how to get a `FeatureForm` from a `FeatureFormDefinition` and an `ArcGISFeature`:

```cs
var featureForm = new FeatureForm(feature, definition);
```

To display a `FeatureForm` in the UI:

```xml
<esri:FeatureFormView x:Name="featureFormView" />
```


To present a `FeatureForm` in a `FeatureFormView`:

```cs
featureFormView.FeatureForm = featureForm;
```

To apply the edits, you can make your own buttons and allow users to submit or discard edits.

```xml
<Button Content="Discard" Click="DiscardButton_Click" />
<Button Content="Apply" Click="ApplyButton_Click" IsEnabled="{Binding IsValid, ElementName=featureFormView}" />
```
```cs
private void DiscardButton_Click(object sender, RoutedEventArgs e)
{
var result = MessageBox.Show("Discard edits?", "Confirm", MessageBoxButton.YesNo);
if(result == MessageBoxResult.Yes)
formViewer.FeatureForm.DiscardEdits();
}
private async void ApplyButton_Click(object sender, RoutedEventArgs e)
{
// Collect all errors to display to the user (If you disable the button with the above 'IsValid' binding expression this step isn't necessary)
// Note that often you'll still be able to apply edits ignoring the feature form's set of rules, as long as those rules don't violate the underlying table schema.
var errors = await formViewer.FeatureForm.EvaluateExpressionsAsync(); //Ensure all expressions are fully evaluated.
var errorList = formViewer.FeatureForm.Elements.OfType<FieldFormElement>().SelectMany(s => s.ValidationErrors).Concat(errors);
if (errorList.Any())
{
MessageBox.Show("Form has errors:\n" + string.Join("\n", errorList.Select(e => e.Message)), "Can't apply");
return;
}
try
{
await formViewer.FeatureForm.Feature.FeatureTable.UpdateFeatureAsync(formViewer.FeatureForm.Feature);
}
catch (Exception ex)
{
MessageBox.Show("Failed to apply edits:\n" + ex.Message, "Error");
}
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>61fbc238-623c-42ff-8c47-95d710a1e66f</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>Esri.ArcGISRuntime.Toolkit.Analyzers.Test</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Verifiers\CSharpAnalyzerVerifier`1+Test.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Verifiers\CSharpAnalyzerVerifier`1.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Verifiers\CSharpCodeFixVerifier`2+Test.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Verifiers\CSharpCodeFixVerifier`2.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Verifiers\CSharpCodeRefactoringVerifier`1+Test.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Verifiers\CSharpCodeRefactoringVerifier`1.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Verifiers\CSharpVerifierHelper.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Verifiers\VisualBasicAnalyzerVerifier`1+Test.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Verifiers\VisualBasicAnalyzerVerifier`1.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Verifiers\VisualBasicCodeFixVerifier`2+Test.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Verifiers\VisualBasicCodeFixVerifier`2.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Verifiers\VisualBasicCodeRefactoringVerifier`1+Test.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Verifiers\VisualBasicCodeRefactoringVerifier`1.cs" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>61fbc238-623c-42ff-8c47-95d710a1e66f</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="Esri.ArcGISRuntime.Toolkit.Analyzers.Test.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Testing.Verifiers;

namespace Esri.ArcGISRuntime.Toolkit.Analyzers.Test
{
public static partial class CSharpAnalyzerVerifier<TAnalyzer>
where TAnalyzer : DiagnosticAnalyzer, new()
{
public class Test : CSharpAnalyzerTest<TAnalyzer, MSTestVerifier>
{
public Test()
{
SolutionTransforms.Add((solution, projectId) =>
{
var compilationOptions = solution.GetProject(projectId).CompilationOptions;
compilationOptions = compilationOptions.WithSpecificDiagnosticOptions(
compilationOptions.SpecificDiagnosticOptions.SetItems(CSharpVerifierHelper.NullableWarnings));
solution = solution.WithProjectCompilationOptions(projectId, compilationOptions);
return solution;
});
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Testing;
using Microsoft.CodeAnalysis.Testing.Verifiers;
using System.Threading;
using System.Threading.Tasks;

namespace Esri.ArcGISRuntime.Toolkit.Analyzers.Test
{
public static partial class CSharpAnalyzerVerifier<TAnalyzer>
where TAnalyzer : DiagnosticAnalyzer, new()
{
/// <inheritdoc cref="AnalyzerVerifier{TAnalyzer, TTest, TVerifier}.Diagnostic()"/>
public static DiagnosticResult Diagnostic()
=> CSharpAnalyzerVerifier<TAnalyzer, MSTestVerifier>.Diagnostic();

/// <inheritdoc cref="AnalyzerVerifier{TAnalyzer, TTest, TVerifier}.Diagnostic(string)"/>
public static DiagnosticResult Diagnostic(string diagnosticId)
=> CSharpAnalyzerVerifier<TAnalyzer, MSTestVerifier>.Diagnostic(diagnosticId);

/// <inheritdoc cref="AnalyzerVerifier{TAnalyzer, TTest, TVerifier}.Diagnostic(DiagnosticDescriptor)"/>
public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor)
=> CSharpAnalyzerVerifier<TAnalyzer, MSTestVerifier>.Diagnostic(descriptor);

/// <inheritdoc cref="AnalyzerVerifier{TAnalyzer, TTest, TVerifier}.VerifyAnalyzerAsync(string, DiagnosticResult[])"/>
public static async Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected)
{
var test = new Test
{
TestCode = source,
};

test.ExpectedDiagnostics.AddRange(expected);
await test.RunAsync(CancellationToken.None);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Testing.Verifiers;
using System.Numerics;

namespace Esri.ArcGISRuntime.Toolkit.Analyzers.Test
{
public static partial class CSharpCodeFixVerifier<TAnalyzer, TCodeFix>
where TAnalyzer : DiagnosticAnalyzer, new()
where TCodeFix : CodeFixProvider, new()
{
public class Test : CSharpCodeFixTest<TAnalyzer, TCodeFix, MSTestVerifier>
{
public Test()
{
SolutionTransforms.Add((solution, projectId) =>
{
var compilationOptions = solution.GetProject(projectId).CompilationOptions;
compilationOptions = compilationOptions.WithSpecificDiagnosticOptions(
compilationOptions.SpecificDiagnosticOptions.SetItems(CSharpVerifierHelper.NullableWarnings));
solution = solution.WithProjectCompilationOptions(projectId, compilationOptions);
return solution;
});
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Testing;
using Microsoft.CodeAnalysis.Testing.Verifiers;
using System.Threading;
using System.Threading.Tasks;

namespace Esri.ArcGISRuntime.Toolkit.Analyzers.Test
{
public static partial class CSharpCodeFixVerifier<TAnalyzer, TCodeFix>
where TAnalyzer : DiagnosticAnalyzer, new()
where TCodeFix : CodeFixProvider, new()
{
/// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.Diagnostic()"/>
public static DiagnosticResult Diagnostic()
=> CSharpCodeFixVerifier<TAnalyzer, TCodeFix, MSTestVerifier>.Diagnostic();

/// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.Diagnostic(string)"/>
public static DiagnosticResult Diagnostic(string diagnosticId)
=> CSharpCodeFixVerifier<TAnalyzer, TCodeFix, MSTestVerifier>.Diagnostic(diagnosticId);

/// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.Diagnostic(DiagnosticDescriptor)"/>
public static DiagnosticResult Diagnostic(DiagnosticDescriptor descriptor)
=> CSharpCodeFixVerifier<TAnalyzer, TCodeFix, MSTestVerifier>.Diagnostic(descriptor);

/// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.VerifyAnalyzerAsync(string, DiagnosticResult[])"/>
public static async Task VerifyAnalyzerAsync(string source, params DiagnosticResult[] expected)
{
var test = new Test
{
TestCode = source,
};

test.ExpectedDiagnostics.AddRange(expected);
await test.RunAsync(CancellationToken.None);
}

/// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.VerifyCodeFixAsync(string, string)"/>
public static async Task VerifyCodeFixAsync(string source, string fixedSource)
=> await VerifyCodeFixAsync(source, DiagnosticResult.EmptyDiagnosticResults, fixedSource);

/// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.VerifyCodeFixAsync(string, DiagnosticResult, string)"/>
public static async Task VerifyCodeFixAsync(string source, DiagnosticResult expected, string fixedSource)
=> await VerifyCodeFixAsync(source, new[] { expected }, fixedSource);

/// <inheritdoc cref="CodeFixVerifier{TAnalyzer, TCodeFix, TTest, TVerifier}.VerifyCodeFixAsync(string, DiagnosticResult[], string)"/>
public static async Task VerifyCodeFixAsync(string source, DiagnosticResult[] expected, string fixedSource)
{
var test = new Test
{
TestCode = source,
FixedCode = fixedSource,
};

test.ExpectedDiagnostics.AddRange(expected);
await test.RunAsync(CancellationToken.None);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Testing.Verifiers;

namespace Esri.ArcGISRuntime.Toolkit.Analyzers.Test
{
public static partial class CSharpCodeRefactoringVerifier<TCodeRefactoring>
where TCodeRefactoring : CodeRefactoringProvider, new()
{
public class Test : CSharpCodeRefactoringTest<TCodeRefactoring, MSTestVerifier>
{
public Test()
{
SolutionTransforms.Add((solution, projectId) =>
{
var compilationOptions = solution.GetProject(projectId).CompilationOptions;
compilationOptions = compilationOptions.WithSpecificDiagnosticOptions(
compilationOptions.SpecificDiagnosticOptions.SetItems(CSharpVerifierHelper.NullableWarnings));
solution = solution.WithProjectCompilationOptions(projectId, compilationOptions);
return solution;
});
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.Testing;
using System.Threading;
using System.Threading.Tasks;

namespace Esri.ArcGISRuntime.Toolkit.Analyzers.Test
{
public static partial class CSharpCodeRefactoringVerifier<TCodeRefactoring>
where TCodeRefactoring : CodeRefactoringProvider, new()
{
/// <inheritdoc cref="CodeRefactoringVerifier{TCodeRefactoring, TTest, TVerifier}.VerifyRefactoringAsync(string, string)"/>
public static async Task VerifyRefactoringAsync(string source, string fixedSource)
{
await VerifyRefactoringAsync(source, DiagnosticResult.EmptyDiagnosticResults, fixedSource);
}

/// <inheritdoc cref="CodeRefactoringVerifier{TCodeRefactoring, TTest, TVerifier}.VerifyRefactoringAsync(string, DiagnosticResult, string)"/>
public static async Task VerifyRefactoringAsync(string source, DiagnosticResult expected, string fixedSource)
{
await VerifyRefactoringAsync(source, new[] { expected }, fixedSource);
}

/// <inheritdoc cref="CodeRefactoringVerifier{TCodeRefactoring, TTest, TVerifier}.VerifyRefactoringAsync(string, DiagnosticResult[], string)"/>
public static async Task VerifyRefactoringAsync(string source, DiagnosticResult[] expected, string fixedSource)
{
var test = new Test
{
TestCode = source,
FixedCode = fixedSource,
};

test.ExpectedDiagnostics.AddRange(expected);
await test.RunAsync(CancellationToken.None);
}
}
}
Loading

0 comments on commit fbea93f

Please sign in to comment.