Пример #1
0
        public Property DeleteAsync_KnownId_ReturnsItem(StringNotNullAndContainsNoNulls id, BankClientProfile value)
        {
            Func <bool> rule = () =>
            {
                value.Id = id.Item;
                BankClientProfile _ = _repo.UpsertAsync(value).Result;
                _dbMultiEntityMethods.SaveChangesAsync().Wait();

                _repo.RemoveAsync(value).Wait();
                _dbMultiEntityMethods.SaveChangesAsync().Wait();

                return(_repo.GetAsync(id.Item).Result == null);
            };

            return(rule.When(value != null));
        }
Пример #2
0
        public Property GetAsync_KnownId_ReturnsItem(StringNotNullAndContainsNoNulls id)
        {
            Func <bool> rule = () =>
            {
                BankClientProfile value = new BankClientProfile
                {
                    Id = id.Item
                };
                BankClientProfile _ = _repo.UpsertAsync(value).GetAwaiter().GetResult();
                _dbMultiEntityMethods.SaveChangesAsync().Wait();

                return(_repo.GetAsync(id.Item).Result.Id == id.Item);
            };

            return(rule.ToProperty());
        }
Пример #3
0
        public Property SetAsync_KnownId_ElementReplaced(
            StringNotNullAndContainsNoNulls id,
            BankClientProfile value,
            BankClientProfile value2)
        {
            Func <bool> rule = () =>
            {
                value.Id  = id.Item;
                value2.Id = id.Item;

                BankClientProfile _  = _repo.UpsertAsync(value).Result;
                BankClientProfile __ = _repo.UpsertAsync(value2).Result;
                _dbMultiEntityMethods.SaveChangesAsync().Wait();

                BankClientProfile item = _repo.GetAsync(id.Item).Result;

                return(item.Id == id.Item && item.XFapiFinancialId == value2.XFapiFinancialId);
            };

            // Run test avoiding C null character
            return(rule.When(
                       value != null && value2 != null &&
                       value.XFapiFinancialId != value2.XFapiFinancialId));
        }
Пример #4
0
        public bool FsCheckStringNotNullAndContainsNoNulls_WorksCorrectly(StringNotNullAndContainsNoNulls s)
        {
            bool?outcome = !s.Item?.Contains("\0");

            return(outcome ?? false);
        }