[#11] Tests: Add MemberServiceTest
This commit is contained in:
@ -39,7 +39,7 @@ namespace Elwig.ViewModels {
|
||||
[ObservableProperty]
|
||||
private bool _enableSearchInputs = true;
|
||||
[ObservableProperty]
|
||||
private IEnumerable<bool> _memberHasDeliveries = [ .. Enumerable.Range(0, 9999).Select(i => false) ];
|
||||
private IEnumerable<bool> _memberHasDeliveries = [.. Enumerable.Range(0, 9999).Select(i => false)];
|
||||
|
||||
[ObservableProperty]
|
||||
private bool _memberListOrderByMgNr;
|
||||
@ -50,10 +50,16 @@ namespace Elwig.ViewModels {
|
||||
|
||||
[ObservableProperty]
|
||||
private string? _mgNrString;
|
||||
public int? MgNr => int.TryParse(MgNrString, out var mgnr) ? mgnr : null;
|
||||
public int? MgNr {
|
||||
get => int.TryParse(MgNrString, out var mgnr) ? mgnr : null;
|
||||
set => MgNrString = $"{value}";
|
||||
}
|
||||
[ObservableProperty]
|
||||
private string? _predecessorMgNrString;
|
||||
public int? PredecessorMgNr => int.TryParse(PredecessorMgNrString, out var mgnr) ? mgnr : null;
|
||||
public int? PredecessorMgNr {
|
||||
get => int.TryParse(PredecessorMgNrString, out var mgnr) ? mgnr : null;
|
||||
set => PredecessorMgNrString = $"{value}";
|
||||
}
|
||||
[ObservableProperty]
|
||||
private bool _isJuridicalPerson;
|
||||
[ObservableProperty]
|
||||
@ -76,7 +82,10 @@ namespace Elwig.ViewModels {
|
||||
private string? _address;
|
||||
[ObservableProperty]
|
||||
private string? _plzString;
|
||||
public int? Plz => int.TryParse(PlzString, out var plz) ? plz : null;
|
||||
public int? Plz {
|
||||
get => int.TryParse(PlzString, out var plz) ? plz : null;
|
||||
set => PlzString = $"{value}";
|
||||
}
|
||||
[ObservableProperty]
|
||||
private AT_PlzDest? _ort;
|
||||
[ObservableProperty]
|
||||
@ -88,7 +97,10 @@ namespace Elwig.ViewModels {
|
||||
private string? _billingAddress;
|
||||
[ObservableProperty]
|
||||
private string? _billingPlzString;
|
||||
public int? BillingPlz => int.TryParse(BillingPlzString, out var plz) ? plz : null;
|
||||
public int? BillingPlz {
|
||||
get => int.TryParse(BillingPlzString, out var plz) ? plz : null;
|
||||
set => BillingPlzString = $"{value}";
|
||||
}
|
||||
[ObservableProperty]
|
||||
private AT_PlzDest? _billingOrt;
|
||||
[ObservableProperty]
|
||||
@ -114,7 +126,10 @@ namespace Elwig.ViewModels {
|
||||
private string? _exitDate;
|
||||
[ObservableProperty]
|
||||
private string? _businessSharesString;
|
||||
public int? BusinessShares => int.TryParse(BusinessSharesString, out var bs) ? bs : null;
|
||||
public int? BusinessShares {
|
||||
get => int.TryParse(BusinessSharesString, out var bs) ? bs : null;
|
||||
set => BusinessSharesString = $"{value}";
|
||||
}
|
||||
[ObservableProperty]
|
||||
private string? _accountingNr;
|
||||
[ObservableProperty]
|
||||
@ -147,6 +162,14 @@ namespace Elwig.ViewModels {
|
||||
public string? _number = number;
|
||||
[ObservableProperty]
|
||||
public string? _comment = comment;
|
||||
|
||||
public override bool Equals(object? obj) {
|
||||
return obj is PhoneNr nr && Type == nr.Type && Number == nr.Number && Comment == nr.Comment;
|
||||
}
|
||||
|
||||
public override int GetHashCode() {
|
||||
return Type ^ (Number?.GetHashCode() ?? 0) ^ (Comment?.GetHashCode() ?? 0);
|
||||
}
|
||||
}
|
||||
public ObservableCollection<PhoneNr> PhoneNrs { get; private set; } = [new(), new(), new(), new(), new(), new(), new(), new(), new()];
|
||||
|
||||
|
Reference in New Issue
Block a user