示例#1
0
        public void InsertDemand_AllowedInputs()
        {
            // The captain hook demand
            Demand demand = _captainHookGenerator.GenerateDemand();

            _service.ValidateForDemandInsertion(demand);

            // With minimal data
            Demand demand2 = new Demand()
            {
                provider = new Provider()
                {
                    organisation = "test",
                    name         = "name",
                    mail         = "*****@*****.**"
                },
                consumables = new List <Consumable>()
                {
                    new Consumable()
                    {
                        category = "MASKE",
                        amount   = 10,
                        unit     = "Stück"
                    }
                }
            };

            _service.ValidateForDemandInsertion(demand2);
        }
示例#2
0
        public async void Insert_AllowedInputs()
        {
            // With an address
            Demand demand = _captainHookGenerator.GenerateDemand();
            var    token  = await _resourceDemandUpdateService.InsertAsync(demand);

            Assert.True(!string.IsNullOrEmpty(token));
            // TODO Querying by token and check for equality (after query by token is possible)

            // Without an address
            Demand demand2 = _captainHookGenerator.GenerateDemand();

            demand.provider.address = null;
            var token2 = await _resourceDemandUpdateService.InsertAsync(demand2);

            Assert.True(!string.IsNullOrEmpty(token2));
            // TODO Querying by token and check for equality (after query by token is possible)
        }