public Problem(Event Event, TimeSpan TimeLimit, int MemoryLimit, int MinimumTestCases, string EnviromentLocation) { this.TimeLimit = TimeLimit; this.MemoryLimit = MemoryLimit; this.MininumTestCases = MininumTestCases; this.EnvironmentLocation = this.Event.EnvironmentLocation; this.Event = Event; // Default properties this.CreationDateTime = DateTime.Now; this.ModificationDateTime = DateTime.Now; this.Status = ProblemStatus.Created; }
public void ShouldCreatedANewEvent() { // Arrange. var @event = new Event( Title : "Examn #3", Description : "Second evaluation", InitialDateTime : DateTime.Now, FinalDateTime : DateTime.Now.AddHours(2), EnviromentLocation : "Fake location", Kind : EventKind.Exam ); // At the beginning there shuld be 4 events, then.. // after creating a new event the number of items shuld to be 5. // Act _repository.Create(@event); var expected = 5; var actual = _repository.NumberOfEvents(); // Assert Assert.AreEqual(expected, actual); }
public void Update(Event @event) { var oldEvent = (_eventsDataSource.Where(currentEvent => currentEvent.Equals(@event))).FirstOrDefault(); oldEvent = @event; }
public void Remove(Event @event) { _eventsDataSource.Remove(@event); }
public void Create(Event @event) { _eventsDataSource.Add(@event); }
public void RemoveEvent(Event @event) { Events.Remove(@event); }
public Event CreateEvent(Event @event) { Events.Add(@event); return @event; }