src/Cassandra.IntegrationTests/Linq/CqlOperatorTests/SubstractAssign.cs
/// <summary>
/// Validate that SubractAssign does not change the list when an empty list of vals to delete is passed in
/// </summary>
Validate that SubractAssign does not change the list when an empty list of vals to delete is passed in
Validate that SubractAssign does not change the list when an empty list of vals to delete is passed in
[Test]
        public void SubtractAssign_FromList_EmptyList()
        {
            var tupleListType = EntityWithListType.SetupDefaultTable(Session);
            var table = tupleListType.Item1;
            var expectedEntities = tupleListType.Item2;
            var singleEntity = expectedEntities.First();
            var valsToDelete = new List<int>();
            table.Where(t => t.Id == singleEntity.Id).Select(t => new EntityWithListType { ListType = CqlOperator.SubstractAssign(valsToDelete) }).Update().Execute();
            var entityList = table.Where(m => m.Id == singleEntity.Id).ExecuteAsync().Result.ToList();
            Assert.AreEqual(1, entityList.Count);
            singleEntity.AssertEquals(entityList[0]);
        }
[ Test ] public void SubtractAssign_FromList_EmptyList ( ) { var tupleListType = EntityWithListType . SetupDefaultTable ( Session ) ; var table = tupleListType . Item1 ; var expectedEntities = tupleListType . Item2 ; var singleEntity = expectedEntities . First ( ) ; var valsToDelete = new List < int > ( ) ; table . Where ( t => t . Id == singleEntity . Id ) . Select ( t => new EntityWithListType { ListType = CqlOperator . SubstractAssign ( valsToDelete ) } ) . Update ( ) . Execute ( ) ; var entityList = table . Where ( m => m . Id == singleEntity . Id ) . ExecuteAsync ( ) . Result . ToList ( ) ; Assert . AreEqual ( 1 , entityList . Count ) ; singleEntity . AssertEquals ( entityList [ 0 ] ) ; }
Validate that SubractAssign does not change the list when an empty list of vals to delete is passed in
Validate that SubractAssign does not change the list when an empty list of vals to delete is passed in
// SubstractAssign the values // Validate final state of the data