public IHttpActionResult Create(TestEntityModel item)
        {
            if (!this.ModelState.IsValid)
            {
                return this.BadRequest(this.ModelState);
            }

            var authorId = this.userIdProvider.GetUserId();
            var currentUser = this.data.Users.Find(authorId);

            if (currentUser == null)
            {
                return this.BadRequest(string.Format(INVALID_ITEM_FORMAT, "user"));
            }

            var newItem = new TestEntity()
            {
                Name = item.Name,
                User = currentUser,
            };

            this.data.TestEntities.Add(newItem);
            this.data.SaveChanges();

            item.Id = newItem.Id;
            item.UserName = newItem.User.UserName;

            return this.Ok(item);
        }
        private TestEntity[] GenerateValidItems(int itemsCount = 15)
        {
            TestEntity[] itemsSet = new TestEntity[itemsCount];

            for (int i = 0; i < itemsCount; i++)
            {
                var testEntityItem = new TestEntity
                {
                    Name = "Test Name " + i,
                    User = new User(),
                };

                itemsSet[i] = testEntityItem;
            }

            return itemsSet;
        }
        private TestEntity GetValidItem(string marker)
        {
            var newItem = new TestEntity()
            {
                Name = "Test name " + marker,
            };

            return newItem;
        }