public void ShouldHaveDefaultStateOnCreation() { _table = new WorksharingMonitorTable(_modelName); // check if table has any data var elements = _table.Table.Count(_ => true); Assert.IsTrue(elements > 0); }
public void ShouldAddNewModelOpenedEvent() { _table = new WorksharingMonitorTable(_modelName); _table.AddModelOpenedEvent(_modelName); // check if table has any data var elem = _table.GetLastInserted(); Assert.AreEqual(WorksharingEventType.ModelOpen, elem.EventType); }
public void ShouldCreateNewTableForNewlyAddedModelOnInstantiation() { _table = new WorksharingMonitorTable(_modelName); var filter = new BsonDocument("name", _modelName); var dbs = _table.Database.Database.ListCollections(new ListCollectionsOptions { Filter = filter }); Assert.IsTrue(dbs.Any()); }
public void ShouldHaveGetLastInserted() { _table = new WorksharingMonitorTable(_modelName); var eventState = new UserClosedModelEvent(_user); _table.Table.InsertOne(eventState); // check if table has any data var elem = _table.GetLastInserted(); var datesAreEqual = elem.TimeCreated == eventState.TimeCreated; Assert.IsTrue(datesAreEqual); }
public void ResetTable() { _table = new WorksharingMonitorTable(_modelName); _table.Database.Database.DropCollection(_modelName); }