Skip to content

Commit

Permalink
MarimerLLC#1101 Update some unit tests to confirm changes work
Browse files Browse the repository at this point in the history
  • Loading branch information
rockfordlhotka committed Jun 3, 2019
1 parent c95bd11 commit 860f820
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Source/Csla.test/BasicModern/Child.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ namespace Csla.Test.BasicModern
[Serializable]
public class Child : BusinessBase<Child>
{
public static readonly PropertyInfo<int> IdProperty = RegisterProperty<int>(c => c.Id);
public static readonly PropertyInfo<int> IdProperty = RegisterProperty<int>(nameof(Id));
public int Id
{
get { return GetProperty(IdProperty); }
set { SetProperty(IdProperty, value); }
}

public static readonly PropertyInfo<string> NameProperty = RegisterProperty<string>(c => c.Name);
public static readonly PropertyInfo<string> NameProperty = RegisterProperty<string>(nameof(Name));
[Required]
public string Name
{
Expand Down
6 changes: 3 additions & 3 deletions Source/Csla.test/BasicModern/Root.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ namespace Csla.Test.BasicModern
[Serializable]
public class Root : BusinessBase<Root>
{
public static readonly PropertyInfo<int> IdProperty = RegisterProperty<int>(c => c.Id);
public static readonly PropertyInfo<int> IdProperty = RegisterProperty<int>(nameof(Id));
public int Id
{
get { return GetProperty(IdProperty); }
set { SetProperty(IdProperty, value); }
}

public static readonly PropertyInfo<string> NameProperty = RegisterProperty<string>(c => c.Name);
public static readonly PropertyInfo<string> NameProperty = RegisterProperty<string>(nameof(Name));
[Required]
public string Name
{
get { return GetProperty(NameProperty); }
set { SetProperty(NameProperty, value); }
}

public static readonly PropertyInfo<ChildList> ChildrenProperty = RegisterProperty<ChildList>(c => c.Children);
public static readonly PropertyInfo<ChildList> ChildrenProperty = RegisterProperty<ChildList>(nameof(Children));
public ChildList Children
{
get { return GetProperty(ChildrenProperty); }
Expand Down
6 changes: 3 additions & 3 deletions Source/Csla.test/BypassPropertyChecks/BypassBusinessBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public BypassBusinessBase()
MarkOld();
}

protected static PropertyInfo<int> IdProperty = RegisterProperty<int>(c => c.Id, "Id");
protected static PropertyInfo<int> IdProperty = RegisterProperty<int>(nameof(Id), "Id");
public int Id
{
get { return GetProperty<int>(IdProperty); }
Expand All @@ -35,15 +35,15 @@ public int Id2
}

private int _id3;
protected static PropertyInfo<int> Id3Property = RegisterProperty<int>(c => c.Id3, "Id3", RelationshipTypes.PrivateField);
protected static PropertyInfo<int> Id3Property = RegisterProperty<int>(c => c.Id3, "Id3", 0, RelationshipTypes.PrivateField);
public int Id3
{
get { return GetProperty<int>(Id3Property, _id3); }
set { SetProperty<int>(Id3Property.Name, ref _id3, value, Csla.Security.NoAccessBehavior.ThrowException); }
}

private int _id4;
protected static PropertyInfo<int> Id4Property = RegisterProperty<int>(c => c.Id4, "Id4", RelationshipTypes.PrivateField);
protected static PropertyInfo<int> Id4Property = RegisterProperty<int>(c => c.Id4, "Id4", 0, RelationshipTypes.PrivateField);
public int Id4
{
get { return GetProperty<int>(Id4Property, _id4); }
Expand Down
4 changes: 2 additions & 2 deletions Source/Csla.test/ValidationRules/ValidationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ protected override void Execute(Rules.IRuleContext context)
[Serializable]
public class HasPrivateFields : BusinessBase<HasPrivateFields>
{
public static PropertyInfo<string> NameProperty = RegisterProperty<string>(c => c.Name, RelationshipTypes.PrivateField);
public static PropertyInfo<string> NameProperty = RegisterProperty<string>(nameof(Name), RelationshipTypes.PrivateField);
private string _name = NameProperty.DefaultValue;
public string Name
{
Expand Down Expand Up @@ -688,7 +688,7 @@ protected override void Execute(Rules.IRuleContext context)
[Serializable]
public class HasLazyField : BusinessBase<HasLazyField>
{
public static PropertyInfo<string> Value1Property = RegisterProperty<string>(c => c.Value1, RelationshipTypes.LazyLoad);
public static PropertyInfo<string> Value1Property = RegisterProperty<string>(nameof(Value1), RelationshipTypes.LazyLoad);
public string Value1
{
get
Expand Down
4 changes: 2 additions & 2 deletions Source/csla.netcore.test/BasicModern/Child.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ namespace Csla.Test.BasicModern
[Serializable]
public class Child : BusinessBase<Child>
{
public static readonly PropertyInfo<int> IdProperty = RegisterProperty<int>(c => c.Id);
public static readonly PropertyInfo<int> IdProperty = RegisterProperty<int>(nameof(Id));
public int Id
{
get { return GetProperty(IdProperty); }
set { SetProperty(IdProperty, value); }
}

public static readonly PropertyInfo<string> NameProperty = RegisterProperty<string>(c => c.Name);
public static readonly PropertyInfo<string> NameProperty = RegisterProperty<string>(nameof(Name));
[Required]
public string Name
{
Expand Down
6 changes: 3 additions & 3 deletions Source/csla.netcore.test/BasicModern/Root.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ namespace Csla.Test.BasicModern
[Serializable]
public class Root : BusinessBase<Root>
{
public static readonly PropertyInfo<int> IdProperty = RegisterProperty<int>(c => c.Id);
public static readonly PropertyInfo<int> IdProperty = RegisterProperty<int>(nameof(Id));
public int Id
{
get { return GetProperty(IdProperty); }
set { SetProperty(IdProperty, value); }
}

public static readonly PropertyInfo<string> NameProperty = RegisterProperty<string>(c => c.Name);
public static readonly PropertyInfo<string> NameProperty = RegisterProperty<string>(nameof(Name));
[Required]
public string Name
{
get { return GetProperty(NameProperty); }
set { SetProperty(NameProperty, value); }
}

public static readonly PropertyInfo<ChildList> ChildrenProperty = RegisterProperty<ChildList>(c => c.Children);
public static readonly PropertyInfo<ChildList> ChildrenProperty = RegisterProperty<ChildList>(nameof(Children));
public ChildList Children
{
get { return GetProperty(ChildrenProperty); }
Expand Down

0 comments on commit 860f820

Please sign in to comment.