Esempio n. 1
0
        public void create_value_adds_value()
        {
            var initialCount = _repo.Get(new BaseSearchParams()).Result.Items.Cast <Value>().Count();
            var created      = _fcd.Create(_newValue).Result;
            var laterCount   = _repo.Get(new BaseSearchParams()).Result.Items.Cast <Value>().Count();

            laterCount.ShouldBe(initialCount + 1);

            created = _fcd.Get(created.Id).Result;
        }
Esempio n. 2
0
        public async Task <IHttpActionResult> Post([FromBody] ValueWriteDto value)
        {
            var added = await _valuesFcd.Create(value);

            return(CreatedAtRoute("default", new { id = added.Id }, added));
        }