Ejemplo n.º 1
0
        public void Single_Async_NoSuchRecord()
        {
            string cqlToFindNothing = _selectAllDefaultCql + " where moviemaker ='" + Randomm.RandomAlphaNum(20) + "'";

            Assert.Throws <AggregateException>(() => _mapper.SingleAsync <Movie>(cqlToFindNothing).Wait());
        }
Ejemplo n.º 2
0
        public void Delete_NoSuchRecord()
        {
            var table = new Table <AllDataTypesEntity>(_session, new MappingConfiguration());
            var count = table.Count().Execute();

            Assert.AreEqual(_entityList.Count, count);
            AllDataTypesEntity entityToDelete = _entityList[0];
            var selectQuery = table.Select(m => m).Where(m => m.StringType == entityToDelete.StringType + Randomm.RandomAlphaNum(16));
            var deleteQuery = selectQuery.Delete();

            deleteQuery.Execute();

            // make sure record was not deleted
            count = table.Count().Execute();
            Assert.AreEqual(_entityList.Count, count);
            List <AllDataTypesEntity> rows = table.Select(m => m).Where(m => m.StringType == entityToDelete.StringType).Execute().ToList();

            Assert.AreEqual(1, rows.Count);
        }
Ejemplo n.º 3
0
        public void DeleteIf_NotAllKeysRestricted_ClusteringKeyOmitted()
        {
            // Validate pre-test state
            var table = new Table <AllDataTypesEntity>(_session, new MappingConfiguration());
            var count = table.Count().Execute();

            Assert.AreEqual(_entityList.Count, count);
            AllDataTypesEntity entityToDelete = _entityList[0];

            // Test
            var selectQuery   = table.Select(m => m).Where(m => m.StringType == entityToDelete.StringType + Randomm.RandomAlphaNum(10));
            var deleteIfQuery = selectQuery.DeleteIf(m => m.IntType == entityToDelete.IntType);

            Assert.Throws <InvalidQueryException>(() => deleteIfQuery.Execute());
        }
Ejemplo n.º 4
0
        public void LinqUpdate_UpdateBatchType(BatchType batchType)
        {
            // Setup
            var table = new Table <Movie>(_session, new MappingConfiguration());

            table.CreateIfNotExists();
            var movieToUpdate1 = _movieList[1];
            var movieToUpdate2 = _movieList[2];

            var batch = table.GetSession().CreateBatch(batchType);

            var expectedMovie1 = new Movie(movieToUpdate1.Title, movieToUpdate1.Director, "something_different_" + Randomm.RandomAlphaNum(10), movieToUpdate1.MovieMaker, 1212);
            var update1        = table.Where(m => m.Title == movieToUpdate1.Title && m.MovieMaker == movieToUpdate1.MovieMaker && m.Director == movieToUpdate1.Director)
                                 .Select(m => new Movie {
                Year = expectedMovie1.Year, MainActor = expectedMovie1.MainActor
            })
                                 .Update();

            batch.Append(update1);

            var expectedMovie2 = new Movie(movieToUpdate2.Title, movieToUpdate2.Director, "also_something_different_" + Randomm.RandomAlphaNum(10), movieToUpdate2.MovieMaker, 1212);
            var update2        = table.Where(m => m.Title == movieToUpdate2.Title && m.MovieMaker == movieToUpdate2.MovieMaker && m.Director == movieToUpdate2.Director)
                                 .Select(m => new Movie {
                Year = expectedMovie2.Year, MainActor = expectedMovie2.MainActor
            })
                                 .Update();

            batch.Append(update2);

            batch.Execute();

            var actualMovieList = table.Execute().ToList();

            Assert.AreEqual(_movieList.Count, actualMovieList.Count);
            Assert.AreNotEqual(expectedMovie1.MainActor, expectedMovie2.MainActor);
            Assert.IsFalse(Movie.ListContains(_movieList, expectedMovie1));
            Assert.IsFalse(Movie.ListContains(_movieList, expectedMovie2));
            Movie.AssertListContains(actualMovieList, expectedMovie1);
            Movie.AssertListContains(actualMovieList, expectedMovie2);
        }
Ejemplo n.º 5
0
        public void Update_NoSuchRecord()
        {
            // Setup
            Movie movieToUpdate = _movieList[1];

            // Update to different values
            var expectedMovie = new Movie(movieToUpdate.Title + "_something_different", movieToUpdate.Director, "something_different_" + Randomm.RandomAlphaNum(10), movieToUpdate.MovieMaker + "_something_different", 1212);

            _mapper.Update(expectedMovie);

            List <Movie> actualMovieList = _movieTable.Execute().ToList();

            Assert.AreEqual(_movieList.Count + 1, actualMovieList.Count());
            Assert.IsFalse(Movie.ListContains(_movieList, expectedMovie));
            Assert.IsTrue(Movie.ListContains(actualMovieList, expectedMovie));
            Movie.AssertListContains(actualMovieList, movieToUpdate);
        }
Ejemplo n.º 6
0
        public void First_NoSuchRecord()
        {
            string cqlToFindNothing = _selectAllDefaultCql + " where moviemaker ='" + Randomm.RandomAlphaNum(20) + "'";
            var    err = Assert.Throws <InvalidOperationException>(() => _mapper.First <Movie>(cqlToFindNothing));

            Assert.AreEqual("Sequence contains no elements", err.Message);
        }
Ejemplo n.º 7
0
        public void Append_ToArray()
        {
            Tuple <Table <EntityWithArrayType>, List <EntityWithArrayType> > tupleArrayType = EntityWithArrayType.SetupDefaultTable(_session);
            Table <EntityWithArrayType> table            = tupleArrayType.Item1;
            List <EntityWithArrayType>  expectedEntities = tupleArrayType.Item2;

            string[]            arrToAdd       = new string[] { "random_" + Randomm.RandomAlphaNum(10), "random_" + Randomm.RandomAlphaNum(10), "random_" + Randomm.RandomAlphaNum(10), };
            EntityWithArrayType singleEntity   = expectedEntities.First();
            EntityWithArrayType expectedEntity = singleEntity.Clone();
            List <string>       strValsAsList  = new List <string>();

            strValsAsList.AddRange(expectedEntity.ArrayType);
            strValsAsList.AddRange(arrToAdd);
            expectedEntity.ArrayType = strValsAsList.ToArray();
            // Append the values
            table.Where(t => t.Id == singleEntity.Id).Select(t => new EntityWithArrayType {
                ArrayType = CqlOperator.Append(arrToAdd)
            }).Update().Execute();
            // Validate the final state of the data
            var entityList = table.Where(m => m.Id == singleEntity.Id).ExecuteAsync().Result.ToList();

            Assert.AreEqual(1, entityList.Count);
            Assert.AreNotEqual(expectedEntity.ArrayType, singleEntity.ArrayType);
            expectedEntity.AssertEquals(entityList[0]);
        }
        public static Taxonomy CreateTaxonomy()
        {
            var taxonomyEntity = Randomm.Create <TaxonomyEntity>();

            return(CreateTaxonomyFrom(taxonomyEntity));
        }
        public static User CreateUser()
        {
            var userEntity = Randomm.Create <UserEntity>();

            return(CreateUserFrom(userEntity));
        }
        public static SynonymGroup CreateSynonymGroup()
        {
            var synonymGroupEntity = Randomm.Create <SynonymGroupEntity>();

            return(CreateSynonymGroupFrom(synonymGroupEntity));
        }
        public static SynonymWord CreateSynonymWord()
        {
            var synonymWordEntity = Randomm.Create <SynonymWordEntity>();

            return(CreateSynonymWordFrom(synonymWordEntity));
        }
        // #database_ef_changes_v2-17-09-2020: (probably no longer valid, service revisions removed)
        //public static ServiceRevision CreateServiceRevision()
        //{
        //    var serviceRevisionEntity = new Fixture().Create<ServiceRevisionEntity>();
        //    return CreateServiceRevisionFrom(serviceRevisionEntity);
        //}

        public static Session CreateSession()
        {
            var sessionEntity = Randomm.Create <SessionEntity>();

            return(CreateSessionFrom(sessionEntity));
        }
        public static Service CreateService()
        {
            var serviceEntity = Randomm.Create <ServiceEntity>();

            return(CreateServiceFrom(serviceEntity));
        }
        public static Role CreateRole()
        {
            var roleEntity = Randomm.Create <RoleEntity>();

            return(CreateRoleFrom(roleEntity));
        }
Ejemplo n.º 15
0
        public async Task ReturnsThatMatchingService()
        {
            // arrange
            DatabaseContext.Database.RollbackTransaction();
            var service = EntityHelpers.CreateService();

            DatabaseContext.Services.Add(service);
            DatabaseContext.SaveChanges();
            var expectedService  = DatabaseContext.Services.FirstOrDefault();
            var searchSearviceId = expectedService.Id;
            // act
            var requestUri     = new Uri($"api/v1/services/{searchSearviceId}?postcode={Randomm.Postcode()}", UriKind.Relative);
            var response       = Client.GetAsync(requestUri).Result;
            var content        = response.Content;
            var stringResponse = await content.ReadAsStringAsync().ConfigureAwait(true);

            var actualService = JsonConvert.DeserializeObject <GetServiceResponse>(stringResponse);

            // assert
            response.StatusCode.Should().Be(200);
            actualService.Service.Id.Should().Be(expectedService.Id);
            actualService.Service.Status.Should().Be(service.Status);
        }
        public static Organization CreateOrganization()
        {
            var organizationEntity = Randomm.Create <OrganizationEntity>();

            return(CreateOrganizationFrom(organizationEntity));
        }
Ejemplo n.º 17
0
        public void Update_PartitionKeyOmitted()
        {
            // Setup
            Movie movieToUpdate = _movieList[1];

            // Update to different values
            var    expectedMovie  = new Movie(movieToUpdate.Title + "_something_different", movieToUpdate.Director, "something_different_" + Randomm.RandomAlphaNum(10), null, 1212);
            var    err            = Assert.Throws <InvalidQueryException>(() => _mapper.Update(expectedMovie));
            string expectedErrMsg = "Invalid null value (for partition key part|in condition for column) moviemaker";

            StringAssert.IsMatch(expectedErrMsg, err.Message);
        }
        public static UserRole CreateUserRole()
        {
            var userRoleEntity = Randomm.Create <UserRoleEntity>();

            return(CreateUserRoleFrom(userRoleEntity));
        }
Ejemplo n.º 19
0
        public static NestedCollectionsPoco GetRandomInstance()
        {
            Dictionary <string, Dictionary <string, long> > nestedDictionaryDictionary = new Dictionary <string, Dictionary <string, long> >();

            nestedDictionaryDictionary.Add(Randomm.RandomAlphaNum(10), new Dictionary <string, long>()
            {
                { Randomm.RandomAlphaNum(10), 123456789L }
            });
            List <Dictionary <string, string> > nestedListDictionary = new List <Dictionary <string, string> >();

            nestedListDictionary.Add(new Dictionary <string, string>()
            {
                { Randomm.RandomAlphaNum(10), Randomm.RandomAlphaNum(10) }, { Randomm.RandomAlphaNum(10), Randomm.RandomAlphaNum(10) }
            });
            nestedListDictionary.Add(new Dictionary <string, string>()
            {
                { Randomm.RandomAlphaNum(10), Randomm.RandomAlphaNum(10) }, { Randomm.RandomAlphaNum(10), Randomm.RandomAlphaNum(10) }
            });
            SortedList <string, Dictionary <string, DateTime> > nestedSortedListDictionary = new SortedList <string, Dictionary <string, DateTime> >();

            nestedSortedListDictionary.Add("abc", new Dictionary <string, DateTime>()
            {
                { Randomm.RandomAlphaNum(10), DateTime.Now.AddDays(1) }
            });
            nestedSortedListDictionary.Add("zyz", new Dictionary <string, DateTime>()
            {
                { Randomm.RandomAlphaNum(10), DateTime.Now.AddHours(900) }
            });
            nestedSortedListDictionary.Add("def", new Dictionary <string, DateTime>()
            {
                { Randomm.RandomAlphaNum(10), DateTime.Now.AddHours(1) }
            });

            NestedCollectionsPoco randomInstance = new NestedCollectionsPoco
            {
                StringType = "StringType_val_" + Randomm.RandomAlphaNum(10),
                GuidType   = Guid.NewGuid(),
                NestedDictionaryDictionary = nestedDictionaryDictionary,
                NestedListDictionary       = nestedListDictionary,
                NestedSortedListDictionary = nestedSortedListDictionary,
            };

            return(randomInstance);
        }
        public void MassiveAsyncTest()
        {
            Cluster  localCluster = _builder.Build();
            ISession localSession = localCluster.Connect();
            string   keyspaceName = "kp_mat_" + Randomm.RandomAlphaNum(8);

            localSession.Execute(
                string.Format(@"CREATE KEYSPACE {0} 
                    WITH replication = {{ 'class' : 'SimpleStrategy', 'replication_factor' : 2 }};"
                              , keyspaceName));
            localSession.ChangeKeyspace(keyspaceName);

            string tableName = "table" + Randomm.RandomAlphaNum(8);

            localSession.Execute(string.Format(@"CREATE TABLE {0}(
                    tweet_id uuid,
                    author text,
                    body text,
                    isok boolean,
                    PRIMARY KEY(tweet_id))", tableName));

            int RowsNo = 100;
            var ar     = new bool[RowsNo];
            var thr    = new Thread(() =>
            {
                for (int i = 0; i < RowsNo; i++)
                {
                    int tmpi = i;
                    localSession.BeginExecute(string.Format(@"INSERT INTO {0} (
                             tweet_id,
                             author,
                             isok,
                             body)
                            VALUES ({1},'test{2}',{3},'body{2}');", tableName, Guid.NewGuid(), i, i % 2 == 0 ? "false" : "true")
                                              , ConsistencyLevel.One, _ =>
                    {
                        ar[tmpi] = true;
                        Interlocked.MemoryBarrier();
                    }, null);
                }
            });

            thr.Start();

            var done = new HashSet <int>();

            while (done.Count < RowsNo)
            {
                for (int i = 0; i < RowsNo; i++)
                {
                    Interlocked.MemoryBarrier();
                    if (!done.Contains(i) && ar[i])
                    {
                        done.Add(i);
                    }
                }
            }

            thr.Join();

            Trace.TraceInformation("Inserted... now we are checking the count");

            var ret = localSession.Execute(string.Format(@"SELECT * from {0} LIMIT {1};", tableName, RowsNo + 100), ConsistencyLevel.Quorum);

            Assert.AreEqual(RowsNo, ret.GetRows().ToList().Count);
            localSession.Dispose();
        }
Ejemplo n.º 21
0
        public void Append_ToArray_QueryUsingCql()
        {
            Tuple <Table <EntityWithArrayType>, List <EntityWithArrayType> > tupleArrayType = EntityWithArrayType.SetupDefaultTable(_session);
            Table <EntityWithArrayType> table            = tupleArrayType.Item1;
            List <EntityWithArrayType>  expectedEntities = tupleArrayType.Item2;

            string[]            arrToAdd       = new string[] { "random_" + Randomm.RandomAlphaNum(10), "random_" + Randomm.RandomAlphaNum(10), "random_" + Randomm.RandomAlphaNum(10), };
            EntityWithArrayType singleEntity   = expectedEntities.First();
            EntityWithArrayType expectedEntity = singleEntity.Clone();
            List <string>       strValsAsList  = new List <string>();

            strValsAsList.AddRange(expectedEntity.ArrayType);
            strValsAsList.AddRange(arrToAdd);
            expectedEntity.ArrayType = strValsAsList.ToArray();
            // Append the values
            table.Where(t => t.Id == singleEntity.Id).Select(t => new EntityWithArrayType {
                ArrayType = CqlOperator.Append(arrToAdd)
            }).Update().Execute();
            // Validate the final state of the data
            List <Row> rows = _session.Execute("SELECT * from " + table.Name + " where id='" + expectedEntity.Id + "'").GetRows().ToList();

            Assert.AreEqual(1, rows.Count);
            Assert.AreNotEqual(expectedEntity.ArrayType, singleEntity.ArrayType);
            string[] actualArr = rows[0].GetValue <string[]>("arraytype");
            Assert.AreEqual(expectedEntity.ArrayType, actualArr);
        }
        public void ParallelInsertTest()
        {
            Cluster  localCluster = _builder.Build();
            ISession localSession = localCluster.Connect();
            string   keyspaceName = "kp_pi1_" + Randomm.RandomAlphaNum(10);

            localSession.Execute(string.Format(@"CREATE KEYSPACE {0} WITH replication = {{ 'class' : 'SimpleStrategy', 'replication_factor' : 2 }};", keyspaceName));

            TestUtils.WaitForSchemaAgreement(localCluster);
            localSession.ChangeKeyspace(keyspaceName);

            for (int KK = 0; KK < 1; KK++)
            {
                string tableName = "table" + Guid.NewGuid().ToString("N").ToLower();
                try
                {
                    localSession.Execute(string.Format(@"
                        CREATE TABLE {0}(
                        tweet_id uuid,
                        author text,
                        body text,
                        isok boolean,
                        PRIMARY KEY(tweet_id))", tableName));

                    TestUtils.WaitForSchemaAgreement(localCluster);
                }
                catch (AlreadyExistsException)
                {
                }

                int RowsNo   = 1000;
                var ar       = new IAsyncResult[RowsNo];
                var threads  = new List <Thread>();
                var monit    = new object();
                int readyCnt = 0;
                Trace.TraceInformation("Preparing...");

                for (int idx = 0; idx < RowsNo; idx++)
                {
                    int i = idx;
                    threads.Add(new Thread(() =>
                    {
                        try
                        {
                            lock (monit)
                            {
                                readyCnt++;
                                Monitor.Wait(monit);
                            }

                            ar[i] = localSession.BeginExecute(string.Format(@"
                                INSERT INTO {0} (tweet_id, author, isok, body) 
                                VALUES ({1},'test{2}',{3},'body{2}');",
                                                                            tableName, Guid.NewGuid(), i, i % 2 == 0 ? "false" : "true"), ConsistencyLevel.One, null, null);
                            Interlocked.MemoryBarrier();
                        }
                        catch
                        {
                        }
                    }));
                }

                for (int idx = 0; idx < RowsNo; idx++)
                {
                    threads[idx].Start();
                }

                lock (monit)
                {
                    while (true)
                    {
                        if (readyCnt < RowsNo)
                        {
                            Monitor.Exit(monit);
                            Thread.Sleep(100);
                            Monitor.Enter(monit);
                        }
                        else
                        {
                            Monitor.PulseAll(monit);
                            break;
                        }
                    }
                }

                Trace.TraceInformation("Start!");

                var done = new HashSet <int>();
                while (done.Count < RowsNo)
                {
                    for (int i = 0; i < RowsNo; i++)
                    {
                        Interlocked.MemoryBarrier();
                        if (!done.Contains(i) && ar[i] != null)
                        {
                            if (ar[i].AsyncWaitHandle.WaitOne(10))
                            {
                                try
                                {
                                    localSession.EndExecute(ar[i]);
                                }
                                catch (Exception ex)
                                {
                                    Trace.TraceError("There was an exception while trying to end the async Execution: " + Environment.NewLine + ex);
                                }
                                done.Add(i);
                            }
                        }
                    }
                }

                Trace.TraceInformation("Inserted... now we are checking the count");

                var ret = localSession.Execute(string.Format(@"SELECT * from {0} LIMIT {1};", tableName, RowsNo + 100), ConsistencyLevel.Quorum);
                Assert.AreEqual(RowsNo, ret.GetRows().ToList().Count);


                for (int idx = 0; idx < RowsNo; idx++)
                {
                    threads[idx].Join();
                }
            }
        }
Ejemplo n.º 23
0
        public void LinqUpdate_Single_Async()
        {
            // Setup
            var table = new Table <Movie>(_session, new MappingConfiguration());

            table.CreateIfNotExists();
            var movieToUpdate = _movieList[1];

            var expectedMovie = new Movie(movieToUpdate.Title, movieToUpdate.Director, "something_different_" + Randomm.RandomAlphaNum(10), movieToUpdate.MovieMaker, 1212);

            table.Where(m => m.Title == movieToUpdate.Title && m.MovieMaker == movieToUpdate.MovieMaker && m.Director == movieToUpdate.Director)
            .Select(m => new Movie {
                Year = expectedMovie.Year, MainActor = expectedMovie.MainActor
            })
            .Update()
            .Execute();

            var actualMovieList = table.ExecuteAsync().Result.ToList();

            Assert.AreEqual(_movieList.Count, actualMovieList.Count());
            Assert.IsFalse(Movie.ListContains(_movieList, expectedMovie));
            Movie.AssertListContains(actualMovieList, expectedMovie);
        }
Ejemplo n.º 24
0
        public void Prepend_ToArray()
        {
            Tuple <Table <EntityWithArrayType>, List <EntityWithArrayType> > tupleArrayType = EntityWithArrayType.SetupDefaultTable(_session);
            Table <EntityWithArrayType> table            = tupleArrayType.Item1;
            List <EntityWithArrayType>  expectedEntities = tupleArrayType.Item2;

            string[]            arrToAdd     = new string[] { "random_" + Randomm.RandomAlphaNum(10), "random_" + Randomm.RandomAlphaNum(10), "random_" + Randomm.RandomAlphaNum(10), };
            EntityWithArrayType singleEntity = expectedEntities.First();

            // Append the values
            table.Where(t => t.Id == singleEntity.Id).Select(t => new EntityWithArrayType {
                ArrayType = CqlOperator.Prepend(arrToAdd)
            }).Update().Execute();
            // Validate the final state of the data
            var entityList = table.Where(m => m.Id == singleEntity.Id).ExecuteAsync().Result.ToList();

            Assert.AreEqual(1, entityList.Count);
            CollectionAssert.AreEqual(arrToAdd.Concat(singleEntity.ArrayType).OrderBy(v => v), entityList[0].ArrayType.OrderBy(v => v));
        }
Ejemplo n.º 25
0
        public void Update_PartitionKeyOmitted()
        {
            // Setup
            Movie movieToUpdate = _movieList[1];

            // Update to different values
            var expectedMovie = new Movie(movieToUpdate.Title + "_something_different", movieToUpdate.Director, "something_different_" + Randomm.RandomAlphaNum(10), null, 1212);
            var err           = Assert.Throws <InvalidQueryException>(() => _mapper.Update(expectedMovie));

            Assert.AreEqual("Invalid null value for partition key part moviemaker", err.Message);
        }
Ejemplo n.º 26
0
        public void DeleteIf_NotAllKeysRestricted_ClusteringKeyOmitted()
        {
            // Validate pre-test state
            var table = new Table <AllDataTypesEntity>(_session, new MappingConfiguration());
            var count = table.Count().Execute();

            Assert.AreEqual(_entityList.Count, count);
            AllDataTypesEntity entityToDelete = _entityList[0];

            // Test
            var selectQuery   = table.Select(m => m).Where(m => m.StringType == entityToDelete.StringType + Randomm.RandomAlphaNum(10));
            var deleteIfQuery = selectQuery.DeleteIf(m => m.IntType == entityToDelete.IntType);
            var ex            = Assert.Throws <InvalidQueryException>(() => deleteIfQuery.Execute());

            StringAssert.Contains(
                "DELETE statements must restrict all PRIMARY KEY columns with equality relations in order to use IF conditions, but column 'guid_type' is not restricted",
                ex.Message);
        }
Ejemplo n.º 27
0
        public void LinqFirstOrDefault_Sync_NoSuchRecord()
        {
            var first = _movieTable.FirstOrDefault(m => m.Director == "non_existant_" + Randomm.RandomAlphaNum(10)).Execute();

            Assert.IsNull(first);
        }
Ejemplo n.º 28
0
        public void Single_Async_NoSuchRecord()
        {
            string cqlToFindNothing = _selectAllDefaultCql + " where moviemaker ='" + Randomm.RandomAlphaNum(20) + "'";

            try
            {
                _mapper.SingleAsync <Movie>(cqlToFindNothing).Wait();
            }
            catch (AggregateException e)
            {
                Assert.AreEqual("Sequence contains no elements", e.InnerException.Message);
            }
        }
Ejemplo n.º 29
0
        public void DeleteIf_NoMatchingRecord()
        {
            // Validate pre-test state
            var table = new Table <AllDataTypesEntity>(_session, new MappingConfiguration());
            var count = table.Count().Execute();

            Assert.AreEqual(_entityList.Count, count);
            AllDataTypesEntity entityToDelete = _entityList[0];

            // Test
            var selectQuery   = table.Select(m => m).Where(m => m.StringType == entityToDelete.StringType + Randomm.RandomAlphaNum(10) && m.GuidType == Guid.NewGuid());
            var deleteIfQuery = selectQuery.DeleteIf(m => m.IntType == entityToDelete.IntType);

            var appliedInfo = deleteIfQuery.Execute();

            Assert.False(appliedInfo.Applied);
        }
Ejemplo n.º 30
0
        public void Single_NoSuchRecord()
        {
            string cqlToFindNothing = _selectAllDefaultCql + " where moviemaker ='" + Randomm.RandomAlphaNum(20) + "'";

            Assert.Throws <InvalidOperationException>(() => _mapper.Single <Movie>(cqlToFindNothing));
        }