Exemplo n.º 1
0
 public static void AssertMovieFullIsSame(MovieFullStream expected, MovieFullStream actual)
 {
     Assert.AreEqual(expected.id, actual.id, "Id not matching");
     Assert.AreEqual(expected.Title, actual.Title, "Title not matching");
     Assert.AreEqual(expected.PartitionKey, actual.PartitionKey, "PartitionKey not matching");
     Assert.AreEqual(expected.Tagline, actual.Tagline, "Tagline not matching");
     Assert.AreEqual(expected.Runtime, actual.Runtime, "Runtime not matching");
     Assert.AreEqual(expected.Revenue, actual.Revenue, "Revenue not matching");
     Assert.AreEqual(expected.ReleaseDate, actual.ReleaseDate, "ReleaseDate not matching");
     Assert.AreEqual(expected.Overview, actual.Overview, "Overview not matching");
     Assert.AreEqual(expected.Language, actual.Language, "Language not matching");
     Assert.AreEqual(expected.Keywords.Count(), actual.Keywords.Count(), "Keywords not matching");
     Assert.AreEqual(expected.Genres.Count(), actual.Genres.Count(), "Genres not matching");
     Assert.AreEqual(expected.Format, actual.Format, "Format not matching");
     Assert.AreEqual(expected.Budget, actual.Budget, "Budget not matching");
     Assert.AreEqual(expected.Cast.Count, actual.Cast.Count, "Cast not matching");
     AssertRatingIsSame(expected.Rating, actual.Rating);
 }
Exemplo n.º 2
0
        public static async Task Initialize(TestContext context)
        {
            var moviesCsv = Helpers.GetFromCsv <MovieCsv>(moviesTestDataPath);
            var castCsv   = Helpers.GetFromCsv <CastCsv>(castTestDataPath);

            var cast = castCsv.GroupBy(k => k.MovieId).ToDictionary(k => k.Key, v => v.ToList());

            _moviesWithCast = moviesCsv.Select(m => MovieFull.GetMovieFull(m, cast.ContainsKey(m.TmdbId) ? cast[m.TmdbId] : new List <CastCsv>())).ToList();
            //Don't add Cast into the movie document - testing performance vs graph
            _movies       = moviesCsv.Select(m => MovieFull.GetMovieFull(m, new List <CastCsv>())).ToList();
            _moviesStream = moviesCsv.Select(m => MovieFullStream.GetMovieFullStream(m, new List <CastCsv>())).ToList();

            Assert.AreEqual(4802, moviesCsv.Count());

            _cosmosClient = await CosmosClientSql.GetByConnectionString(connectionString, databaseId, containerId);

            var r = await _cosmosClient.Container.ReadContainerAsync();

            _partitionKeyPropertyName = r.Resource.PartitionKeyPath.Trim('/');
        }