public InvalidOperationTests() { var modelBuilder = new ModelBuilder(); IReadOnlyModel model = modelBuilder.Model; _provider = new MySqlProvider(model); }
public void start() { if ((_devices != null) && (_devices.Count > 0)) { EventHandler <StatusChangeEventArgs> shandler = (sender, e) => { if (e.OldValue != null) { _traceWrapper.WriteInformation("new Msg: " + e.NewValue.DisplayValue + " ; old Msg: " + e.OldValue.DisplayValue + " ; date: " + e.TimeReached.ToUniversalTime()); } else { _traceWrapper.WriteInformation("Msg: " + e.NewValue.DisplayValue + " ; date: " + e.TimeReached.ToUniversalTime()); } }; EventHandler <RaisingEdgeEventArgs> rhandler = (sender, e) => { _traceWrapper.WriteInformation("Raising: " + e.Raising.ToString() + " ; date: " + e.TimeReached.ToUniversalTime()); }; EventHandler <FallingEdgeEventArgs> fhandler = (sender, e) => { _traceWrapper.WriteInformation("FallingEdge: " + e.Falling.ToString() + " ; date: " + e.TimeReached.ToUniversalTime()); }; ITriggerProvider tr = (ITriggerProvider)(((IDevice)_devices[0])); ((IDevice)_devices[0]).StatusChange += shandler; tr.RaisingEdge += rhandler; tr.FallingEdge += fhandler; _traceWrapper.WriteInformation("start()"); ((IDevice)_devices[0]).Start(); Thread.Sleep(3000); // 3 sec ((IDevice)_devices[0]).StatusChange -= shandler; tr.RaisingEdge -= rhandler; tr.FallingEdge -= fhandler; } }
public void SoftDOTrigger() { using (var resetEvent = new ManualResetEventSlim(false)) { EventHandler <RaisingEdgeEventArgs> rhandler = (sender, e) => { _traceWrapper.WriteInformation("Reboot SUCCESS: " + " ; date: " + e.TimeReached.ToUniversalTime()); resetEvent.Set(); }; EventHandler <FallingEdgeEventArgs> fhandler = (sender, e) => { _traceWrapper.WriteInformation("Reboot SUCCESS: " + " ; date: " + e.TimeReached.ToUniversalTime()); resetEvent.Set(); }; ITriggerProvider tr = (ITriggerProvider)(((IDevice)_devices[0])); tr.RaisingEdge += rhandler; tr.FallingEdge += fhandler; ((IDevice)_devices[0]).Start(); Thread.Sleep(3000); ((ILaser)_devices[0]).DOSetOutput(1, 1); ((ILaser)_devices[0]).DOOutput(); Assert.IsTrue(resetEvent.Wait(TimeSpan.FromMilliseconds(3000))); tr.RaisingEdge -= rhandler; tr.FallingEdge -= fhandler; } }
public static void AssertGeneratedInsertSql(this ITriggerProvider provider, string sql, Expression <Func <SourceEntity, DestinationEntity> > expression) { var trigger = new OnInsertTriggerInsertAction <SourceEntity, DestinationEntity>(expression); var generatedSql = trigger.BuildSql(provider); Assert.Equal(sql, generatedSql); }
public Tests() { _context = new TestDbContext(new DbContextOptionsBuilder <TestDbContext>() .UseSqlServer() .UseTriggers() .Options); _provider = new SqlServerProvider(_context.Model); }
public ConditionGeneratingTests() { var modelBuilder = new ModelBuilder(); modelBuilder.Entity <User>() .Property <UserRole>("Role"); _model = modelBuilder.Model; _provider = new MySqlProvider(_model); }
public SetupProviderConverterTests() { var modelBuilder = new ModelBuilder(); modelBuilder.Entity <Transaction>() .Property <string>("Description"); IReadOnlyModel model = modelBuilder.Model; _provider = new MySqlProvider(model); }
public void FallingEdge() { using (var resetEvent = new ManualResetEventSlim(false)) { EventHandler <FallingEdgeEventArgs> handler = (sender, e) => { _traceWrapper.WriteInformation("FallingEdge: " + e.Falling.ToString() + " ; date: " + e.TimeReached.ToUniversalTime()); resetEvent.Set(); }; ITriggerProvider tr = (ITriggerProvider)(((IDevice)_devices[0])); tr.FallingEdge += handler; ((IDevice)_devices[0]).Start(); Assert.IsTrue(resetEvent.Wait(TimeSpan.FromMilliseconds(30000))); tr.FallingEdge -= handler; } }
protected UnitStringFunctionsTests(ITriggerProvider provider) { Provider = provider; }
public virtual SqlBuilder BuildSql(ITriggerProvider visitor) => visitor.GetTriggerUpsertActionSql(this);
public BaseGeneratingExpressionsTests(ITriggerProvider visitor) { Visitor = visitor; }
protected UnitRawSqlTests(ITriggerProvider provider) { Provider = provider; }
protected BaseMemberAssignmentUnitTests(ITriggerProvider provider) { Provider = provider; }
protected UnitMathFunctionsTests(ITriggerProvider provider) { Provider = provider; }