public void InsertAsync() { var sample = CreateRandomEntity(1); int res = _repository.InsertAsync(sample).Result; Assert.NotEqual(default(int), sample.Id); var r = _repository.Query().Where(p => p.Id == sample.Id).FirstOrDefault(); FullCompare(sample, r); }
public async Task InsertAsync() { var oneHourElectricity = new OneHourElectricity { DateTime = DateTime.UtcNow, KiloWatt = 12312, PanelId = 1 }; var insertResponse = await _repository.InsertAsync(oneHourElectricity); Assert.NotEqual(default(int), oneHourElectricity.Id); }
public void TestAnalyticsRepository() { IAnalyticsRepository analytics = new AnalyticsRepository(new CrossSolarDbContext()); OneHourElectricity oneHourElectricity = new OneHourElectricity() { DateTime = DateTime.Now, KiloWatt = 312, PanelId = "12" }; analytics.InsertAsync(oneHourElectricity); var result = analytics.GetByPanelIdAsync("12"); Assert.NotNull(result); }