public void SingleUpdate_DatabaseIsNull_ThrowsException()
        {
            DatabaseMock database = null;
            var          logger   = new ConsoleLogMock();
            SingleUpdate singleUpdate;

            Assert.ThrowsException <NullReferenceException>(() =>
                                                            singleUpdate = new SingleUpdate(database, logger));
        }
        public void SingleUpdateStartMeasure_DocumentListIsNull_ThrowsException()
        {
            var             database     = new DatabaseMock();
            var             logger       = new ConsoleLogMock();
            SingleUpdate    singleUpdate = new SingleUpdate(database, logger);
            List <Document> documentList = null;

            Assert.ThrowsException <NullReferenceException>(() =>
                                                            singleUpdate.StartMeasure(documentList));
        }
 public void Remove(SingleUpdate update)
 {
     if (updateList.Any(o => o == update))
     {
         updateList.RemoveAll(o => o == update);
     }
     else
     {
         Debug.LogWarning("SingleUpdateManager: Did not found a matching entry for given SingleUpdate, cannot remove.");
     }
 }
 public void Register(SingleUpdate update)
 {
     if (!updateList.Any(o => o == update))
     {
         updateList.Add(update);
     }
     else
     {
         Debug.LogWarning("SingleUpdateManager: Already found an entry for this SingleUpdate, ignoring.");
     }
 }
        public void StartMeasure_EveryDocumentGetsUpdated_UpdateListHasEveryDocument()
        {
            //Arrange
            var          database     = new DatabaseMock();
            var          logger       = new ConsoleLogMock();
            SingleUpdate singleUpdate = new SingleUpdate(database, logger);

            var operatorenList = new List <Operatoren>();

            operatorenList.Add(new Operatoren()
            {
                Name = "Lance", Shoesize = 21
            });

            var documentList = new List <Document>()
            {
                new Document()
                {
                    ID          = 1,
                    machineName = "Rolle",
                    Operatoren  = new List <Operatoren>()
                    {
                        new Operatoren()
                        {
                            Name = "Lance", Shoesize = 21
                        }
                    }
                },
                new Document()
                {
                    ID          = 2,
                    machineName = "Rolle",
                    Operatoren  = new List <Operatoren>()
                    {
                        new Operatoren()
                        {
                            Name = "Lance", Shoesize = 21
                        }
                    }
                },
                new Document()
                {
                    ID          = 3,
                    machineName = "Rolle",
                    Operatoren  = new List <Operatoren>()
                    {
                        new Operatoren()
                        {
                            Name = "Lance", Shoesize = 21
                        }
                    }
                }
            };

            //Act
            singleUpdate.StartMeasure(documentList);

            Assert.IsTrue(database.documentsFromSingleUpdate[0] == documentList[0] &&
                          database.documentsFromSingleUpdate[1] == documentList[1] &&
                          database.documentsFromSingleUpdate[2] == documentList[2]);
            Assert.AreEqual(database.documentsFromSingleInsert.Count, documentList.Count);
        }
Ejemplo n.º 6
0
 public EffectBuilder AnimateUpdate(SingleUpdate update)
 {
     imageEffect.update = new SingleUpdate(update);
     return(this);
 }