Esempio n. 1
0
 public void NormallyInsertInteger()
 {
     using (var container = new RhetosTestContainer())
     {
         var repository = container.Resolve<Common.DomRepository>();
         var entity = new SimpleInteger { Value = 1 };
         repository.TestMaxValue.SimpleInteger.Insert(new[] { entity });
     }
 }
Esempio n. 2
0
 public void NormallyInsertInteger()
 {
     using (var executionContext = new CommonTestExecutionContext())
     {
         var repository = new Common.DomRepository(executionContext);
         var entity = new SimpleInteger { Value = 1 };
         repository.TestMaxValue.SimpleInteger.Insert(new[] { entity });
     }
 }
Esempio n. 3
0
 public void ShouldThowUserExceptionOnInsertInteger()
 {
     using (var container = new RhetosTestContainer())
     {
         var repository = container.Resolve<Common.DomRepository>();
         var entity = new SimpleInteger { Value = 3 };
         repository.TestMaxValue.SimpleInteger.Insert(new[] { entity });
     }
 }
Esempio n. 4
0
 public void NormallyInsertInteger()
 {
     using (var container = new RhetosTestContainer())
     {
         var repository = container.Resolve<Common.DomRepository>();
         var entity = new SimpleInteger { Value = 3 };
         repository.TestMinValue.SimpleInteger.Insert(entity);
     }
 }
Esempio n. 5
0
 public void ShouldThowUserExceptionOnInsertInteger()
 {
     using (var container = new RhetosTestContainer())
     {
         var repository = container.Resolve<Common.DomRepository>();
         var entity = new SimpleInteger { Value = 1 };
         repository.TestMinValue.SimpleInteger.Insert(entity);
     }
 }
Esempio n. 6
0
 public void NullValue()
 {
     using (var container = new RhetosTestContainer())
     {
         var repository = container.Resolve<Common.DomRepository>();
         var entity = new SimpleInteger { ID = Guid.NewGuid(), Value = null };
         repository.TestMinValue.SimpleInteger.Insert(entity);
         Assert.IsNull(repository.TestMinValue.SimpleInteger.Filter(new[] { entity.ID }).Single().Value);
     }
 }
 public void NormallyInsertInteger()
 {
     using (var scope = TestScope.Create())
     {
         var repository = scope.Resolve <Common.DomRepository>();
         var entity     = new SimpleInteger {
             Value = 3
         };
         repository.TestMinValue.SimpleInteger.Insert(entity);
     }
 }
 public void ShouldThowUserExceptionOnInsertInteger()
 {
     using (var scope = TestScope.Create())
     {
         var repository = scope.Resolve <Common.DomRepository>();
         var entity     = new SimpleInteger {
             Value = 1
         };
         repository.TestMinValue.SimpleInteger.Insert(entity);
     }
 }
Esempio n. 9
0
        public void ShouldThowUserExceptionOnUpdate()
        {
            using (var container = new RhetosTestContainer())
            {
                var repository = container.Resolve<Common.DomRepository>();
                var entity = new SimpleInteger { Value = 10 };
                repository.TestMinValue.SimpleInteger.Insert(entity);

                entity.Value = 1;
                repository.TestMinValue.SimpleInteger.Update(entity);
            }
        }
Esempio n. 10
0
 public void NullValue()
 {
     using (var scope = TestScope.Create())
     {
         var repository = scope.Resolve <Common.DomRepository>();
         var entity     = new SimpleInteger {
             ID = Guid.NewGuid(), Value = null
         };
         repository.TestMinValue.SimpleInteger.Insert(entity);
         Assert.IsNull(repository.TestMinValue.SimpleInteger.Load(new[] { entity.ID }).Single().Value);
     }
 }
Esempio n. 11
0
        public void ShouldThowUserExceptionOnUpdate()
        {
            using (var container = new RhetosTestContainer())
            {
                var repository = container.Resolve <Common.DomRepository>();
                var entity     = new SimpleInteger {
                    Value = 1
                };
                repository.TestMaxValue.SimpleInteger.Insert(new[] { entity });

                entity.Value = 10;
                repository.TestMaxValue.SimpleInteger.Update(new[] { entity });
            }
        }
Esempio n. 12
0
        public void ShouldThowUserExceptionOnUpdate()
        {
            using (var scope = TestScope.Create())
            {
                var repository = scope.Resolve <Common.DomRepository>();
                var entity     = new SimpleInteger {
                    Value = 1
                };
                repository.TestMaxValue.SimpleInteger.Insert(new[] { entity });

                entity.Value = 10;
                repository.TestMaxValue.SimpleInteger.Update(new[] { entity });
            }
        }
Esempio n. 13
0
    // Start is called before the first frame update
    void Start()
    {
        var si = new SimpleInteger {
            data = 1
        };
        DateTime start = DateTime.Now;

        for (int x = 0; x < 1000000; x += 1)
        {
            list_of_ints.RemoveAt(0);
            list_of_ints.Add(si);
        }

        DateTime end = DateTime.Now;

        Debug.Log("Insert at the end and remove at 0: " + (end.Ticks - start.Ticks).ToString());

        start = DateTime.Now;

        for (int x = 0; x < 1000000; x += 1)
        {
            queue_of_ints.Dequeue();
            queue_of_ints.Enqueue(si);
        }

        end = DateTime.Now;
        Debug.Log("Insert at the end and remove at 0: " + (end.Ticks - start.Ticks).ToString());


        start = DateTime.Now;
        foreach (var d in list_of_ints)
        {
            d.data += 1;
        }
        end = DateTime.Now;
        Debug.Log("Traverse: " + (end.Ticks - start.Ticks).ToString());


        start = DateTime.Now;
        foreach (var d in queue_of_ints)
        {
            d.data += 1;
        }
        end = DateTime.Now;
        Debug.Log("Traverse: " + (end.Ticks - start.Ticks).ToString());
    }
Esempio n. 14
0
 public void NullValue()
 {
     using (var container = new RhetosTestContainer())
     {
         var repository = container.Resolve<Common.DomRepository>();
         var entity = new SimpleInteger { ID = Guid.NewGuid(), Value = null };
         repository.TestMaxValue.SimpleInteger.Insert(new[] { entity });
         Assert.IsNull(repository.TestMaxValue.SimpleInteger.Filter(new[] { entity.ID }).Single().Value);
     }
 }
Esempio n. 15
0
 public void NullValue()
 {
     using (var executionContext = new CommonTestExecutionContext())
     {
         var repository = new Common.DomRepository(executionContext);
         var entity = new SimpleInteger { ID = Guid.NewGuid(), Value = null };
         repository.TestMaxValue.SimpleInteger.Insert(new[] { entity });
         Assert.IsNull(repository.TestMaxValue.SimpleInteger.Filter(new[] { entity.ID }).Single().Value);
     }
 }
Esempio n. 16
0
        public void ShouldThowUserExceptionOnUpdate()
        {
            using (var executionContext = new CommonTestExecutionContext())
            {
                var repository = new Common.DomRepository(executionContext);
                var entity = new SimpleInteger { Value = 1 };
                repository.TestMaxValue.SimpleInteger.Insert(new[] { entity });

                entity.Value = 10;
                repository.TestMaxValue.SimpleInteger.Update(new[] { entity });
            }
        }