public void ConstructorShouldSetSuppliedParametersoProperties()
        {
            var now  = DateTime.UtcNow;
            var mock = new Mock <BaseFault>(now);

            mock.CallBase = true;

            BaseFault target = mock.Object;

            Assert.AreEqual(now, target.Timestamp);
        }
        public void ConstructorShouldSetDateToUtc()
        {
            var now = DateTime.Now;

            Assert.AreEqual(DateTimeKind.Local, now.Kind); // Sanity check

            var mock = new Mock <BaseFault>(now);

            mock.CallBase = true;

            BaseFault target = mock.Object;

            Assert.AreEqual(now.ToUniversalTime(), target.Timestamp);
        }
Esempio n. 3
0
 public VeloObject GetByFeature(long featureId)
 {
     try
     {
         return(((IVeloObjectDAO)GetDAO()).GetByFeature(featureId));
     }
     catch (Exception ex)
     {
         if (ExceptionManager != null)
         {
             ExceptionManager.HandleException(ex, Policies.AbstractServicePolicy);
         }
         var f = new BaseFault(ex, ServiceSecurityContext.Current.PrimaryIdentity.Name);
         throw new FaultException <BaseFault>(f);
     }
 }
Esempio n. 4
0
 public IEnumerable <VeloObject> FilterVeloObjects(ICollection <ITS.Core.Domain.Filters.Filter> veloobjectFilters)
 {
     try
     {
         return(((IVeloObjectDAO)GetDAO()).FilterVeloObjects(veloobjectFilters));
     }
     catch (Exception ex)
     {
         if (ExceptionManager != null)
         {
             ExceptionManager.HandleException(ex, Policies.AbstractServicePolicy);
         }
         var f = new BaseFault(ex, ServiceSecurityContext.Current.PrimaryIdentity.Name);
         throw new FaultException <BaseFault>(f);
     }
 }
Esempio n. 5
0
 public List <VeloObject> GetVeloObjectsByFeatureObjectIDs(List <long> ids)
 {
     try
     {
         return(((IVeloObjectDAO)GetDAO()).GetVeloObjectsByFeatureObjectIDs(ids));
     }
     catch (Exception ex)
     {
         if (ExceptionManager != null)
         {
             ExceptionManager.HandleException(ex, Policies.AbstractServicePolicy);
         }
         var fault = new BaseFault(ex);
         throw new FaultException <BaseFault>(fault);
     }
 }
Esempio n. 6
0
 public override void DeleteAndCommit(VeloObject entity)
 {
     try
     {
         GetDAO().Delete(entity);
         HistoryManager.Delete(entity, entity.FeatureObject.Layer.Map.Alias);
     }
     catch (Exception ex)
     {
         if (ExceptionManager != null)
         {
             ExceptionManager.HandleException(ex, Policies.AbstractServicePolicy);
         }
         var f = new BaseFault(ex, ServiceSecurityContext.Current.PrimaryIdentity.Name);
         throw new FaultException <BaseFault>(f);
     }
 }
Esempio n. 7
0
 public override VeloObject SaveOrUpdate(VeloObject entity)
 {
     try
     {
         var transient = entity.IsTransient();
         entity = GetDAO().Save(entity);
         HistoryManager.CreateOrUpdate(entity, entity.FeatureObject.Layer.Map.Alias, transient);
     }
     catch (Exception ex)
     {
         if (ExceptionManager != null)
         {
             ExceptionManager.HandleException(ex, Policies.AbstractServicePolicy);
         }
         var f = new BaseFault(ex, ServiceSecurityContext.Current.PrimaryIdentity.Name);
         throw new FaultException <BaseFault>(f);
     }
     return(entity);
 }