public void ClientRepositoryDataModel_GetByName_Success_Test()
            {
                MVoxAuditingEntities.AllInstances.MessageClientsGet = (c) => {
                    FakeObjectSet <MessageClient> objectSet = new FakeObjectSet <MessageClient>();
                    objectSet.Add(new MessageClient()
                    {
                        MessageClientID         = 1,
                        MessageClientIdentifier = "Test"
                    });
                    return(objectSet);
                };
                MVoxAuditingEntities.AllInstances.BatchesGet = (c) => {
                    FakeObjectSet <DataModel.Batch> objectSet = new FakeObjectSet <DataModel.Batch>();
                    objectSet.Add(new DataModel.Batch()
                    {
                        BatchID         = 1,
                        BatchNumber     = "TestBatch",
                        MessageClientID = 1,
                        FinishDate      = null,
                        StartDate       = DateTime.Now
                    });
                    return(objectSet);
                };
                var result = repository.GetByName("Test");

                Assert.IsNotNull(result);
                Assert.AreEqual(1, result.ID);
            }
 public void BatchRepositoryDataModel_Add_ExistingBatchOpen_Test()
 {
     MVoxAuditingEntities.AllInstances.BatchesGet = (c) => {
       FakeObjectSet<Batch> objectSet = new FakeObjectSet<Batch>();
       objectSet.Add(new Batch() {
     BatchID = 1,
     BatchNumber = "Test",
     MessageClientID = 1,
     StartDate = DateTime.Now
       });
       return objectSet;
     };
     bool result = repository.Add(new Model.Batch(0, "Test1") { ClientID = 1 });
 }
            public void BatchRepositoryDataModel_GetByName_Success_Test()
            {
                MVoxAuditingEntities.AllInstances.BatchesGet = (c) => {
                    FakeObjectSet <Batch> objectSet = new FakeObjectSet <Batch>();
                    objectSet.Add(new Batch()
                    {
                        BatchID     = 1,
                        BatchNumber = "Test"
                    });
                    return(objectSet);
                };
                var result = repository.GetByName("Test");

                Assert.IsNotNull(result);
                Assert.AreEqual(1, result.ID);
            }
Example #4
0
            public void MessageRepositoryDataModel_GetByID_Success_Test()
            {
                MVoxAuditingEntities.AllInstances.MessagesGet = (c) => {
                    FakeObjectSet <DataModel.Message> objectSet = new FakeObjectSet <DataModel.Message>();
                    objectSet.Add(new DataModel.Message()
                    {
                        MessageID     = 1,
                        MessageNumber = "Test"
                    });
                    return(objectSet);
                };
                var result = repository.GetByID(1);

                Assert.IsNotNull(result);
                Assert.AreEqual(1, result.ID);
            }
            public void ClientRepositoryDataModel_GetByID_Success_Test()
            {
                MVoxAuditingEntities.AllInstances.MessageClientsGet = (c) => {
                    FakeObjectSet <MessageClient> objectSet = new FakeObjectSet <MessageClient>();
                    objectSet.Add(new MessageClient()
                    {
                        MessageClientID         = 1,
                        MessageClientIdentifier = "Test"
                    });
                    return(objectSet);
                };
                var result = repository.GetByID(1);

                Assert.IsNotNull(result);
                Assert.AreEqual(1, result.ID);
            }
 public void BatchRepositoryDataModel_Update_DoesNotExist_Test()
 {
     MVoxAuditingEntities.AllInstances.BatchesGet = (c) => {
         FakeObjectSet <Batch> objectSet = new FakeObjectSet <Batch>();
         objectSet.Add(new Batch()
         {
             BatchID         = 1,
             BatchNumber     = "Test",
             MessageClientID = 1,
             StartDate       = DateTime.Now
         });
         return(objectSet);
     };
     bool result = repository.Update(new Model.Batch(2, "Test1")
     {
         ClientID = 1, FinishDate = DateTime.Now
     });
 }
Example #7
0
            public void MessageRepositoryDataModel_GetMessageApplicationID_Success_Test()
            {
                Guid aGuid = Guid.NewGuid();

                MVoxAuditingEntities.AllInstances.MessageApplicationsGet = (c) => {
                    FakeObjectSet <DataModel.MessageApplication> objectSet = new FakeObjectSet <DataModel.MessageApplication>();
                    objectSet.Add(new DataModel.MessageApplication()
                    {
                        MessageApplicationID   = 1,
                        MessageApplicationGuid = aGuid,
                        MessageApplicationName = "Test"
                    });
                    return(objectSet);
                };
                var result = repository.GetMessageApplicationID(aGuid);

                Assert.AreEqual(1, result);
            }
Example #8
0
            public void MessageRepositoryDataModel_GetByGuid_Success_Test()
            {
                Guid aGuid = Guid.NewGuid();

                MVoxAuditingEntities.AllInstances.MessagesGet = (c) => {
                    FakeObjectSet <DataModel.Message> objectSet = new FakeObjectSet <DataModel.Message>();
                    objectSet.Add(new DataModel.Message()
                    {
                        MessageID     = 1,
                        MessageNumber = aGuid.ToString()
                    });
                    return(objectSet);
                };
                var result = repository.GetByGuid(aGuid);

                Assert.IsNotNull(result);
                Assert.AreEqual(1, result.ID);
            }
            public void BatchRepositoryDataModel_Update_Success_Test()
            {
                MVoxAuditingEntities.AllInstances.BatchesGet = (c) => {
                    FakeObjectSet <Batch> objectSet = new FakeObjectSet <Batch>();
                    objectSet.Add(new Batch()
                    {
                        BatchID         = 1,
                        BatchNumber     = "Test",
                        MessageClientID = 1,
                        StartDate       = DateTime.Now
                    });
                    return(objectSet);
                };
                MVoxAuditingEntities.AllInstances.SaveChanges = (c) => { return(1); };
                bool result = repository.Update(new Model.Batch(1, "Test")
                {
                    ClientID = 1, FinishDate = DateTime.Now
                });

                Assert.IsTrue(result);
            }
 public void MessageRepositoryDataModel_GetMessageApplicationID_Success_Test()
 {
     Guid aGuid = Guid.NewGuid();
     MVoxAuditingEntities.AllInstances.MessageApplicationsGet = (c) => {
       FakeObjectSet<DataModel.MessageApplication> objectSet = new FakeObjectSet<DataModel.MessageApplication>();
       objectSet.Add(new DataModel.MessageApplication() {
     MessageApplicationID = 1,
     MessageApplicationGuid = aGuid,
     MessageApplicationName = "Test"
       });
       return objectSet;
     };
     var result = repository.GetMessageApplicationID(aGuid);
     Assert.AreEqual(1, result);
 }
 public void MessageRepositoryDataModel_GetByID_Success_Test()
 {
     MVoxAuditingEntities.AllInstances.MessagesGet = (c) => {
       FakeObjectSet<DataModel.Message> objectSet = new FakeObjectSet<DataModel.Message>();
       objectSet.Add(new DataModel.Message() {
      MessageID = 1,
     MessageNumber = "Test"
       });
       return objectSet;
     };
     var result = repository.GetByID(1);
     Assert.IsNotNull(result);
     Assert.AreEqual(1, result.ID);
 }
 public void MessageRepositoryDataModel_GetByGuid_Success_Test()
 {
     Guid aGuid = Guid.NewGuid();
     MVoxAuditingEntities.AllInstances.MessagesGet = (c) => {
       FakeObjectSet<DataModel.Message> objectSet = new FakeObjectSet<DataModel.Message>();
       objectSet.Add(new DataModel.Message() {
     MessageID = 1,
     MessageNumber = aGuid.ToString()
       });
       return objectSet;
     };
     var result = repository.GetByGuid(aGuid);
     Assert.IsNotNull(result);
     Assert.AreEqual(1, result.ID);
 }
 public void BatchRepositoryDataModel_Update_Success_Test()
 {
     MVoxAuditingEntities.AllInstances.BatchesGet = (c) => {
       FakeObjectSet<Batch> objectSet = new FakeObjectSet<Batch>();
       objectSet.Add(new Batch() {
     BatchID = 1,
     BatchNumber = "Test",
     MessageClientID = 1,
     StartDate = DateTime.Now
       });
       return objectSet;
     };
     MVoxAuditingEntities.AllInstances.SaveChanges = (c) => { return 1; };
     bool result = repository.Update(new Model.Batch(1, "Test") { ClientID = 1, FinishDate = DateTime.Now });
     Assert.IsTrue(result);
 }
 public void BatchRepositoryDataModel_GetByName_Success_Test()
 {
     MVoxAuditingEntities.AllInstances.BatchesGet = (c) => {
       FakeObjectSet<Batch> objectSet = new FakeObjectSet<Batch>();
       objectSet.Add(new Batch() {
     BatchID = 1,
     BatchNumber = "Test"
       });
       return objectSet;
     };
     var result = repository.GetByName("Test");
     Assert.IsNotNull(result);
     Assert.AreEqual(1, result.ID);
 }
 public void ClientRepositoryDataModel_GetByID_Success_Test()
 {
     MVoxAuditingEntities.AllInstances.MessageClientsGet = (c) => {
       FakeObjectSet<MessageClient> objectSet = new FakeObjectSet<MessageClient>();
       objectSet.Add(new MessageClient() {
     MessageClientID = 1,
     MessageClientIdentifier = "Test"
       });
       return objectSet;
     };
     var result = repository.GetByID(1);
     Assert.IsNotNull(result);
     Assert.AreEqual(1, result.ID);
 }
 public void ClientRepositoryDataModel_GetByName_Success_Test()
 {
     MVoxAuditingEntities.AllInstances.MessageClientsGet = (c) => {
       FakeObjectSet<MessageClient> objectSet = new FakeObjectSet<MessageClient>();
       objectSet.Add(new MessageClient() {
     MessageClientID = 1,
     MessageClientIdentifier = "Test"
       });
       return objectSet;
     };
     MVoxAuditingEntities.AllInstances.BatchesGet = (c) => {
       FakeObjectSet<DataModel.Batch> objectSet = new FakeObjectSet<DataModel.Batch>();
       objectSet.Add(new DataModel.Batch() {
     BatchID = 1,
     BatchNumber = "TestBatch",
     MessageClientID = 1,
     FinishDate = null,
     StartDate = DateTime.Now
       });
       return objectSet;
     };
     var result = repository.GetByName("Test");
     Assert.IsNotNull(result);
     Assert.AreEqual(1, result.ID);
 }