-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathBindableDerivedListGeneratorTests.cs
More file actions
40 lines (34 loc) · 1.42 KB
/
BindableDerivedListGeneratorTests.cs
File metadata and controls
40 lines (34 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) 2025 ReactiveUI and contributors. All rights reserved.
// Licensed to the ReactiveUI and contributors under one or more agreements.
// The ReactiveUI and contributors licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
using ReactiveUI.SourceGenerators;
using Xunit.Abstractions;
namespace ReactiveUI.SourceGenerator.Tests;
/// <summary>
/// BindableDerivedListGeneratorTests.
/// </summary>
public class BindableDerivedListGeneratorTests(ITestOutputHelper output) : TestBase<BindableDerivedListGenerator>(output)
{
/// <summary>
/// Tests that the source generator correctly generates reactive properties.
/// </summary>
/// <returns>A task to monitor the async.</returns>
[Fact]
public Task FromReactiveProperties()
{
// Arrange: Setup the source code that matches the generator input expectations.
const string sourceCode = """
using System.Collections.ObjectModel;
using DynamicData;
namespace TestNs;
public partial class TestVM
{
[BindableDerivedList]
private ReadOnlyObservableCollection<int> _test1;
}
""";
// Act: Initialize the helper and run the generator. Assert: Verify the generated code.
return TestHelper.TestPass(sourceCode);
}
}