public void OptinallyCreateWithData() { var data = new DataDummy(); var message = new Message("Irrelevant", data); Assert.IsTrue(message.HasData); Assert.AreSame(data, message.GetData <DataDummy>()); }
public async Task AddMany(List <Tabla> entityList) { var data = new DataDummy(); var table = data.DummyTable(entityList); using (var connection = Connection) { //connection.Open(); await connection.ExecuteAsync("usp_InsertTvp", new { Records = table.AsTableValuedParameter("TvpRecords") }, commandType : CommandType.StoredProcedure); } }
public App() { InitializeComponent(); Register(); var data = new DataDummy(); data.GenerateDataDummy(); var application = App.Container.Resolve <IApplicationService>(); application.Start(); }
public void BroadcastWithDataPassesOnDataObject() { var listener = new ListenerSpy(); receiver.SubscribeToMessage("AMessage", listener.Method); var data = new DataDummy(); dispatcher.BroadcastWithData("AMessage", data); Assert.AreSame(data, listener.ReceivedData); }
public void GetDataFieldsNamesTest() { var d = new DataDummy(); var names = d.GetDataFieldsNames(); Assert.AreEqual(trueNames.Length, names.Count); foreach (var tn in trueNames) { Assert.IsTrue(names.Contains(tn)); } }
public async Task AddMany(List <Tabla> entityList) { var data = new DataDummy(); var table = data.DummyTable(entityList); var param = new SqlParameter("@Records", table) { TypeName = "TvpRecords", SqlDbType = SqlDbType.Structured }; await _context.Database.ExecuteSqlRawAsync("exec usp_InsertTvp @Records", param); }
public void GetValuesTest() { var tst = Enumerable.Range(0, 100) .Select(i => new DataDummy() { Index = 1, X = 2, V = 3, IndexInList = -1, P = 1 * i, Ro = 200, p = 300 }); var Ps = DataDummy.GetValues <double>(tst, "P").ToList(); foreach (var i in Enumerable.Range(0, 100).Select(ii => (double)ii)) { Assert.IsTrue(Ps.Contains(i)); } }
public void ThisTest() { var tst = new DataDummy() { Index = 1, X = 2, V = 3, IndexInList = -1, P = 100, Ro = 200, p = 300 }; Assert.AreEqual(1, tst["Index"]); Assert.AreEqual(-1, tst["IndexInList"]); Assert.AreEqual(2d, tst["X"]); Assert.AreEqual(3d, tst["V"]); Assert.AreEqual(100d, tst["P"]); Assert.AreEqual(200d, tst["Ro"]); Assert.AreEqual(300d, tst["p"]); Assert.IsNull(tst["p "]); }