public void Enum_Add_matches_bitwise_operation() { const AccountState bitOperation = AccountState.Closed | AccountState.PastDue; var declarative = AccountState.Closed.Add(AccountState.PastDue); bitOperation.Should().Be(declarative); }
public void Enum_Remove_matches_bitwise_operation() { const AccountState bitwise = (AccountState.Closed | AccountState.PastDue) ^ AccountState.PastDue; var declarative = (AccountState.Closed | AccountState.PastDue).Remove(AccountState.PastDue); bitwise.Should().Be(declarative); }
public void Enum_Is_detects_overlap() { const AccountState state = AccountState.Active | AccountState.PastDue; state.Is(AccountState.PastDue).Should().BeTrue(); state.Is(AccountState.Active).Should().BeTrue(); state.Is(AccountState.Closed).Should().BeFalse(); }
public void String_ParseAsEnum_preserves_flags_parsing() { const AccountState state = AccountState.Active | AccountState.PastDue; var stateString = state.ToString(); var result = stateString.ParseAsEnum <AccountState>(); result.Should().Be(state); }
public void String_ParseAsEnum_parses_AccountState_correctly(string toParse, AccountState expected) { var actual = toParse.ParseAsEnum <AccountState>(); actual.Should().Be(expected); }
public void String_ParseAsEnum_parses_AccountState_correctly(string toParse, AccountState expected) { var actual = toParse.ParseAsEnum<AccountState>(); actual.Should().Be(expected); }