-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathPropertyGenerationTests.cs
More file actions
36 lines (32 loc) · 1.17 KB
/
PropertyGenerationTests.cs
File metadata and controls
36 lines (32 loc) · 1.17 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
using NUnit.Framework;
using System.ComponentModel;
using DevExpress.Mvvm.CodeGenerators.MvvmLight;
namespace MvvmLight.Mvvm.Tests {
[GenerateViewModel(ImplementINotifyPropertyChanging = true)]
partial class GenerateProperties {
[GenerateProperty(IsVirtual = true)]
int property;
}
[GenerateViewModel]
partial class WithTwoMvvmAttribute {
[DevExpress.Mvvm.CodeGenerators.GenerateProperty]
int dxProperty;
[DevExpress.Mvvm.CodeGenerators.GenerateCommand]
void DxMethod() { dxProperty++; }
}
[TestFixture]
public class PropertyGenerationTests {
[Test]
public void PropertyImplementation() {
var generated = new GenerateProperties();
Assert.IsNotNull(generated.GetType().GetProperty("Property"));
Assert.IsNull(generated.GetType().GetProperty("NotProperty"));
}
[Test]
public void DoNotGenerateDxMembers() {
var generated = new WithTwoMvvmAttribute();
Assert.IsNull(generated.GetType().GetProperty("DxProperty"));
Assert.IsNull(generated.GetType().GetProperty("DxMethodCommand"));
}
}
}