Skip to content

Commit

Permalink
Update EventServicesTest.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
bilimig committed Jun 22, 2024
1 parent c170e48 commit 4566cc5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Server/ReasnAPI/ReasnAPI.Tests/Services/EventServicesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void UpdateEvent_EventExists_EventUpdated()
mockContext.Setup(c => c.Parameters).ReturnsDbSet(new List<Parameter>());
mockContext.Setup(c => c.Comments).ReturnsDbSet(new List<Comment>());
mockContext.Setup(c => c.Participants).ReturnsDbSet(new List<Participant>());
var eventService = new EventService(mockContext.Object, new ParameterService(mockContext.Object), new TagService(mockContext.Object), new CommentService(mockContext.Object));
var eventService = new EventService(mockContext.Object, new ParameterService(mockContext.Object), new TagService(mockContext.Object), new CommentService(mockContext.Object), new AddressService(mockContext.Object));

var result = eventService.UpdateEvent(1, eventDto);
Assert.AreEqual("name1", result.Name);
Expand Down Expand Up @@ -144,7 +144,7 @@ public void UpdateEvent_EventDoesNotExist_NullReturned()
UpdatedAt =DateTime.Now
}});

var eventService = new EventService(mockContext.Object, new ParameterService(mockContext.Object), new TagService(mockContext.Object), new CommentService(mockContext.Object));
var eventService = new EventService(mockContext.Object, new ParameterService(mockContext.Object), new TagService(mockContext.Object), new CommentService(mockContext.Object), new AddressService(mockContext.Object));

Assert.ThrowsException<NotFoundException>(() => eventService.UpdateEvent(1, eventDto));
}
Expand Down Expand Up @@ -205,7 +205,7 @@ public void GetEventById_EventExists_EventReturned()
UpdatedAt =DateTime.Now }});


var eventService = new EventService(mockContext.Object, new ParameterService(mockContext.Object), new TagService(mockContext.Object), new CommentService(mockContext.Object));
var eventService = new EventService(mockContext.Object, new ParameterService(mockContext.Object), new TagService(mockContext.Object), new CommentService(mockContext.Object), new AddressService(mockContext.Object));

var result = eventService.GetEventById(1);
Assert.IsNotNull(result);
Expand Down Expand Up @@ -250,7 +250,7 @@ public void GetEventById_EventDoesNotExist_NullReturned()
}});


var eventService = new EventService(mockContext.Object, new ParameterService(mockContext.Object), new TagService(mockContext.Object), new CommentService(mockContext.Object));
var eventService = new EventService(mockContext.Object, new ParameterService(mockContext.Object), new TagService(mockContext.Object), new CommentService(mockContext.Object), new AddressService(mockContext.Object));

Assert.ThrowsException<NotFoundException>(() => eventService.GetEventById(1));
}
Expand Down Expand Up @@ -320,7 +320,7 @@ public void DeleteEvent_EventExists_EventDeleted()
mockContext.Setup(c => c.Comments).ReturnsDbSet(new List<Comment>());
mockContext.Setup(c => c.Participants).ReturnsDbSet(new List<Participant>());

var eventService = new EventService(mockContext.Object, new ParameterService(mockContext.Object), new TagService(mockContext.Object), new CommentService(mockContext.Object));
var eventService = new EventService(mockContext.Object, new ParameterService(mockContext.Object), new TagService(mockContext.Object), new CommentService(mockContext.Object), new AddressService(mockContext.Object));

eventService.DeleteEvent(1);

Expand Down

0 comments on commit 4566cc5

Please sign in to comment.