public void TestItCompilesWithNulls() { var taxiway2 = new GroundNetworkTaxiway( "A", 15, null, null, coordinates, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); Assert.Equal("TAXI:A:15::", taxiway2.GetCompileData(new SectorElementCollection())); }
public CommentService( BaseRepository <CommentEntity> commentRepository, BaseRepository <UserEntity> userRepository, IUserService userService, UserEntityFactory userEntityFactory, CommentFactory commentFactory, IMapper mapper) { _commentRepository = commentRepository; _userRepository = userRepository; _userService = userService; _userEntityFactory = userEntityFactory; _commentFactory = commentFactory; _mapper = mapper; }
public GeoTest() { this.secondPoint = PointFactory.Make(); this.firstPoint = PointFactory.Make(); this.segments = GeoSegmentFactory.MakeList(2); this.model = new Geo( "TestGeo", this.firstPoint, this.secondPoint, "red", this.segments, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public void TestItCompilesWithColour() { RouteSegment routeSegment = new( "FOO", new Point("BIG"), new Point("LAM"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make(), "FooColour" ); Assert.Equal( " BIG BIG LAM LAM FooColour", routeSegment.GetCompileData(new SectorElementCollection()) ); }
public RegionPointTest() { regionPoint = new RegionPoint( new Point("TEST"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); regionPointWithColour = new RegionPoint( new Point("TEST"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make(), "red" ); }
public CoordinationPointTest() { this.model = new CoordinationPoint( false, "*", "*", "ABTUM", "EGKK", "26L", "TCE", "TCSW", "*", "14000", "ABTUMDES", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public void TestItAddsMultiRowElements() { RunParserOnLines(new List <string>( new[] { "Test abc abc def def ;comment", " def def ghi ghi ;comment" } )); List <RouteSegment> expectedAdditionalSegments = new() { new RouteSegment( "Test", new Point("def"), new Point("ghi"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ), }; SidStarRoute result = sectorElementCollection.SidRoutes[0]; Assert.Equal("Test", result.Identifier); Assert.Equal( new RouteSegment( "Test", new Point("abc"), new Point("def"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ), result.InitialSegment ); Assert.Equal(expectedAdditionalSegments, result.Segments); AssertExpectedMetadata(result); AssertExpectedMetadata(result.InitialSegment); AssertExpectedMetadata(result.Segments[0], 2); }
public GroundNetworkRunwayExitTest() { coordinate1 = GroundNetworkCoordinateFactory.Make(new Coordinate("abc", "def")); coordinate2 = GroundNetworkCoordinateFactory.Make(new Coordinate("abc", "ghi")); coordinates = new List <GroundNetworkCoordinate> { coordinate1, coordinate2 }; exit = new GroundNetworkRunwayExit( "27L", "N3W", "LEFT", 15, coordinates, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public void TestItFailsOnInvalidFix(string firstFix, string secondFix) { sectorElements.Add(CircleSectorlineFactory.Make(centre: firstFix)); sectorElements.Add(CircleSectorlineFactory.Make(centre: secondFix)); // This one is ignored by the rule sectorElements.Add( new CircleSectorline( "ONE", new Coordinate("abc", "def"), 5.5, SectorLineDisplayRuleFactory.MakeList(2), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ) ); AssertValidationErrors(); }
public GroundNetworkTaxiwayTest() { coordinate1 = GroundNetworkCoordinateFactory.Make(new Coordinate("abc", "def")); coordinate2 = GroundNetworkCoordinateFactory.Make(new Coordinate("abc", "ghi")); coordinates = new List <GroundNetworkCoordinate> { coordinate1, coordinate2 }; taxiway = new GroundNetworkTaxiway( "A", 15, 1, "55L", coordinates, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public ActionResult GetBlog(string id) { List <SelectListItem> funds = new List <SelectListItem>(); ContentFactory cf = new ContentFactory(); var topicList = cf.GetTopic(Convert.ToInt64(id)); var topicData = topicList.Select(m => new SelectListItem() { Text = m.TopicName, Value = m.TopicId.ToString(), }); var topic = topicList[0]; long TopicID = topic.TopicId; List <BlogEntity> BlogByTopic = new List <BlogEntity>(); BlogByTopic = cf.GetBlogByTopicId(TopicID); ViewBag.Blogs = BlogByTopic; CommentFactory cmf = new CommentFactory(); List <CommentEntity> ListComment = new List <CommentEntity>(); ListComment = cmf.GetComment(); ViewBag.Comments = ListComment; LikeFactory lf = new LikeFactory(); List <LikeEntity> ListLike = new List <LikeEntity>(); ListLike = lf.GetLike(); ViewBag.Likes = ListLike; List <CommentEntity> Comment = new List <CommentEntity>(); string s = string.Empty; foreach (var item in BlogByTopic) { s += item.BlogId + ","; } return(PartialView("_LoadBlogs")); //return Json(topicData, JsonRequestBehavior.AllowGet); }
public async Task DeleteInvalidCommentFromAcvtivity() { // Arrange var activityType = ActivityTypeFactory.Default(); var activity = ActivityFactory.Default(CityId, activityType.Id); var comment = CommentFactory.Default(activity.Id, AuthenticatedUserId); activity.AddComment(comment); await ExecuteDatabaseAction(async (doFestContext) => { await doFestContext.ActivityTypes.AddAsync(activityType); await doFestContext.Activities.AddAsync(activity); await doFestContext.SaveChangesAsync(); }); // Act var response = await HttpClient.DeleteAsync($"api/v1/activities/{activity.Id}/comments/{Guid.NewGuid()}"); // Assert response.IsSuccessStatusCode.Should().BeFalse(); }
public ControllerPositionTest() { this.coordlist = new List <Coordinate>(); this.coordlist.Add(new Coordinate("abc", "def")); this.coordlist.Add(new Coordinate("ghi", "jkl")); this.coordlist.Add(new Coordinate("mno", "pqr")); this.model = new ControllerPosition( "EGBB_APP", "Birmingham Radar", "123.970", "BBR", "B", "EGBB", "APP", "0401", "0407", this.coordlist, PositionOrder.PRE_POSITION, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); }
public void TestItCompilesNoVisCenters() { ControllerPosition newModel = new( "EGBB_APP", "Birmingham Radar", "123.970", "BBR", "B", "EGBB", "APP", "0401", "0407", new List <Coordinate>(), PositionOrder.PRE_POSITION, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); Assert.Equal( "EGBB_APP:Birmingham Radar:123.970:BBR:B:EGBB:APP:-:-:0401:0407", newModel.GetCompileData(new SectorElementCollection()) ); }
public void TestItPassesOnValidRoute() { List <RouteSegment> segments = new() { RouteSegmentFactory.MakeDoublePoint("testvor", "testndb"), RouteSegmentFactory.MakeDoublePoint("testndb", "testairport"), RouteSegmentFactory.MakePointCoordinate("testairport"), RouteSegmentFactory.MakeCoordinatePoint("testfix"), }; SidStarRoute route = new( SidStarType.STAR, "EGKK TEST", RouteSegmentFactory.MakeDoublePoint("testfix", "testvor"), segments, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); sectorElements.Add(route); AssertNoValidationErrors(); }
public void TestItCompilesFirCopx() { CoordinationPoint model2 = new( true, "*", "*", "ABTUM", "EGKK", "26L", "TCE", "TCSW", "*", "14000", "ABTUMDES", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); Assert.Equal( "FIR_COPX:*:*:ABTUM:EGKK:26L:TCE:TCSW:*:14000:ABTUMDES", model2.GetCompileData(new SectorElementCollection()) ); }
public void TestItPassesOnValidBorders() { sectorElements.Add( new Sector( "COOL1", 5000, 66000, SectorOwnerHierarchyFactory.Make(), SectorAlternateOwnerHierarchyFactory.MakeList(2), SectorActiveFactory.MakeList(), SectorGuestFactory.MakeList(), new List <SectorBorder> { new( new List <string> { "ONE", "TWO", }, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ) },
public InfoTest() { this.infoName = new InfoName( "Super Cool Sector", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); this.infoCallsign = new InfoCallsign( "LON_CTR", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); this.infoAirport = new InfoAirport( "EGLL", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); this.infoLatitude = new InfoLatitude( "123", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); this.infoLongitude = new InfoLongitude( "456", DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); this.infoPerDegreeLatitude = new InfoMilesPerDegreeLatitude( 60, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); this.infoPerDegreeLongitude = new InfoMilesPerDegreeLongitude( 40.24, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); this.infoMagVar = new InfoMagneticVariation( 2.1, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); this.infoScale = new InfoScale( 1, DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make() ); this.model = new Info( this.infoName, this.infoCallsign, this.infoAirport, this.infoLatitude, this.infoLongitude, this.infoPerDegreeLatitude, this.infoPerDegreeLongitude, this.infoMagVar, this.infoScale ); }
public CommentsController(CommentFactory commentFactory, MessageFactory messageFactory, UserFactory userFactory) { _commentFactory = commentFactory; _messageFactory = messageFactory; _userFactory = userFactory; }
public CommentsController(CommentFactory comment) { commentFactory = comment; }
public HeaderLineTest() { this.definition = DefinitionFactory.Make(); this.comment = CommentFactory.Make(); this.headerLine = new HeaderLine(this.comment, this.definition); }
public void TestItAddsMultipleElementsWithColour() { RunParserOnLines(new List <string>( new[] { "Test abc abc def def Red", " def def ghi ghi Yellow ;comment", "Test 2 jkl jkl mno mno Blue;comment" } )); List <RouteSegment> expectedAdditionalSegments1 = new() { new RouteSegment( "Test", new Point("def"), new Point("ghi"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make(), "Yellow" ) }; SidStarRoute result = sectorElementCollection.SidRoutes[0]; Assert.Equal("Test", result.Identifier); Assert.Equal( new RouteSegment( "Test", new Point("abc"), new Point("def"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make(), "Red" ), result.InitialSegment ); Assert.Equal(expectedAdditionalSegments1, result.Segments); AssertExpectedMetadata(result, commentString: ""); AssertExpectedMetadata(result.InitialSegment, commentString: ""); AssertExpectedMetadata(result.Segments[0], 2); SidStarRoute result2 = sectorElementCollection.SidRoutes[1]; Assert.Equal("Test 2", result2.Identifier); Assert.Equal( new RouteSegment( "Test", new Point("jkl"), new Point("mno"), DefinitionFactory.Make(), DocblockFactory.Make(), CommentFactory.Make(), "Blue" ), result2.InitialSegment ); Assert.Empty(result2.Segments); AssertExpectedMetadata(result2, 3); AssertExpectedMetadata(result2.InitialSegment, 3); }
public VestViewModel() { _commentFactory = new CommentFactory(); LoadComments(); }
public UsersController(UserFactory user, MessageFactory message, CommentFactory comment) { userFactory = user; messageFactory = message; commentFactory = comment; }