示例#1
0
        public void AccountGroupType_WhenCalled_ReturnsAccountGroupTypeFromAccountGroup(AccountGroupType accountGroupType)
        {
            IAccountGroup accountGroup = _fixture.BuildAccountGroupMock(accountGroupType: accountGroupType).Object;
            IAccount      sut          = CreateSut(accountGroup);

            AccountGroupType result = sut.AccountGroupType;

            Assert.That(result, Is.EqualTo(accountGroupType));
        }
        public void ToDomain_WhenCalled_ReturnsAccountGroupWithAccountGroupTypeFromCommand()
        {
            AccountGroupType     accountGroupType = _fixture.Create <AccountGroupType>();
            IAccountGroupCommand sut = CreateSut(accountGroupType: accountGroupType);

            AccountGroupType result = sut.ToDomain().AccountGroupType;

            Assert.That(result, Is.EqualTo(accountGroupType));
        }
示例#3
0
        public void AccountGroupType_WhenCalled_AssertAccountGroupTypeWasCalledOnAccountGroup()
        {
            Mock <IAccountGroup> accountGroupMock = _fixture.BuildAccountGroupMock();
            IAccount             sut = CreateSut(accountGroupMock.Object);

            AccountGroupType result = sut.AccountGroupType;

            Assert.That(result, Is.AnyOf(AccountGroupType.Assets, AccountGroupType.Liabilities));

            accountGroupMock.Verify(m => m.AccountGroupType, Times.Once);
        }
        public void Validate_WhenCalled_AssertShouldBeKnownValueWasCalledOnObjectValidator()
        {
            AccountGroupType     accountGroupType = _fixture.Create <AccountGroupType>();
            IAccountGroupCommand sut = CreateSut(accountGroupType: accountGroupType);

            sut.Validate(_validatorMockContext.ValidatorMock.Object, _accountingRepositoryMock.Object);

            _validatorMockContext.ObjectValidatorMock.Verify(m => m.ShouldBeKnownValue(
                                                                 It.Is <AccountGroupType>(value => value == accountGroupType),
                                                                 It.IsNotNull <Func <AccountGroupType, Task <bool> > >(),
                                                                 It.Is <Type>(type => type == sut.GetType()),
                                                                 It.Is <string>(field => string.Compare(field, "AccountGroupType", false) == 0),
                                                                 It.Is <bool>(allowNull => allowNull == false)),
                                                             Times.Once());
        }
示例#5
0
 public AccountGroup(int number, string name, AccountGroupType accountGroupType)
     : base(number, name)
 {
     AccountGroupType = accountGroupType;
 }
 private static Task <bool> IsKnownAccountGroupTypeAsync(AccountGroupType accountGroupType)
 {
     return(Task.Run(() => Enum.GetValues(typeof(AccountGroupType)).Cast <AccountGroupType>().Contains(accountGroupType)));
 }