Ejemplo n.º 1
0
        public async Task GetSubmissionWithEntries_GetsFromDb()
        {
            // Arrange
            ImageEntity imageEntity = EntitiesHelper.GetImage();

            var lCreatedEntity = await submissionRepository.Add(new Entities.SubmissionEntity {
                Notes   = "test", SalonYear = EntitiesHelper.GetSalonYear(), Person = EntitiesHelper.GetPerson(),
                Entries = new List <CompetitionEntryEntity>
                {
                    new CompetitionEntryEntity
                    {
                        Image      = imageEntity,
                        Section    = EntitiesHelper.GetSection(),
                        IsAccepted = true,
                        IsAwarded  = false,
                        Score      = 50
                    },
                    new CompetitionEntryEntity
                    {
                        Image   = imageEntity,
                        Section = EntitiesHelper.GetSection(),
                    }
                }
            });

            // Act
            var lResult = await submissionRepository.GetSubmissionWithEntries(lCreatedEntity.Id);

            // Assert
            Assert.IsNotNull(lResult);
            Assert.IsTrue(lResult.Id > 0);
            Assert.AreEqual("test", lResult.Notes);
            Assert.AreEqual(2, lResult.Entries.Count);
        }