public GameContentManager(IServiceProvider services) { _starTypes = new List<Model.StarType>(); _starNames = new List<string>(); _notUsedNames = new List<string>(); _content = (ContentController)services.GetService(typeof(ContentController)); }
public void SetUp() { _mockRouteExplorerService = new Mock<IRouteExplorerService>(); _mockRouteExplorerService .Setup(e => e.GetRouteDescriptions()) .Returns(new List<RouteDescriptionContract> { new RouteDescriptionContract { RelativePath = "some/path" } }); _mockResourceLookup = new Mock<IResourceLookup>(); _mockResourceLookup .Setup(r => r.GetString("index.html")) .Returns("<tagsoup>hello</tagsoup>"); _mockResourceLookup .Setup(r => r.GetString("app.js")) .Returns("var x = 'y';"); _contentController = new ContentController(); // The ContentController class has only a default constructor to prevent IoC containers from // instantiating the class using a greedy strategy, ie picking the constructor with the most parameters. Inject(_contentController, "_routeExplorerService", _mockRouteExplorerService.Object); Inject(_contentController, "_resourceLookup", _mockResourceLookup.Object); }
public GalaxyMapControl(IServiceProvider services) { Name = "Galaxy View"; HorizontalAlignment = HorizontalAlignment.Stretch; VerticalAlignment = VerticalAlignment.Stretch; _spritebatch = (SpriteBatch)services.GetService(typeof(SpriteBatch)); _content = (ContentController)services.GetService(typeof(ContentController)); _gameManager = (GameManager)services.GetService(typeof(GameManager)); _parallax1SpeedMod = 1.5f; _parallax2SpeedMod = 2f; }
public CentauriGame(Game game) : base(game) { _inputService = (IInputService)game.Services.GetService(typeof(IInputService)); _uiService = (IUIService)game.Services.GetService(typeof(IUIService)); _animationService = (IAnimationService)game.Services.GetService(typeof(IAnimationService)); _spritebatch = (SpriteBatch)game.Services.GetService(typeof(SpriteBatch)); _consoleManager = (ConsoleManager)game.Services.GetService(typeof(ConsoleManager)); _content = (ContentController)game.Services.GetService(typeof(ContentController)); _eventManager = (EventManager) game.Services.GetService(typeof (EventManager)); }
public static IContentController GetContentController() { IContentController ctl = ComponentFactory.GetComponent<IContentController>(); if (ctl == null) { ctl = new ContentController(); ComponentFactory.RegisterComponentInstance<IContentController>(ctl); } return ctl; }
public PlanetMapControl(IServiceProvider services) { _content = (ContentController)services.GetService(typeof(ContentController)); _spritebatch = (SpriteBatch)services.GetService(typeof(SpriteBatch)); _consoleManager = (ConsoleManager)services.GetService(typeof(ConsoleManager)); _black = _content.GetContent<Texture2D>(@"StarFields\black"); _font = _content.GetContent<SpriteFont>("Fonts/SpriteFont1"); Name = "PlanetMap"; ClipContent = true; BuildingCellSize = 128; }
public Planet(IServiceProvider services, SystemMapPlanetViewModel viewModel) { ViewModel = viewModel; Scale = ViewModel.Scale; ImageControl = new Image(); _content = (ContentController)services.GetService(typeof(ContentController)); ImageControl.Texture = _content.GetContent<Texture2D>(@"SystemMap\Planet1"); Content = ImageControl; RenderScale = new Vector2F(Scale); }
public void Access_To_Recycle_Bin_By_Path() { //arrange var userMock = new Mock <IUser>(); userMock.Setup(u => u.Id).Returns(0); userMock.Setup(u => u.Groups).Returns(new[] { new ReadOnlyUserGroup(1, "admin", "", -1, -1, "admin", new string[0], new List <string>()) }); var user = userMock.Object; var contentServiceMock = new Mock <IContentService>(); var contentService = contentServiceMock.Object; var userServiceMock = new Mock <IUserService>(); var userService = userServiceMock.Object; var entityServiceMock = new Mock <IEntityService>(); var entityService = entityServiceMock.Object; //act var result = ContentController.CheckPermissions(new Dictionary <string, object>(), user, userService, contentService, entityService, -20); //assert Assert.IsTrue(result); }
public void IndexWithListLandingContent() { ContentController controller = new ContentController(_repo, _mapRepo, null); var result = controller.Index("page2").Result as ViewResult; Assert.IsNotNull(result); Assert.AreEqual <string>("ListLanding", result.ViewName); //test the view model is populated correctly ListLandingContent model = (ListLandingContent)result.ViewData.Model; Assert.AreEqual <string>("<i>News</i> items", model.Content); Assert.AreEqual <ContentType>(ContentType.ListLanding, model.ContentType); Assert.AreEqual <string>("News", model.Title); //validate list items were loaded Assert.IsNotNull(model.Items, "No items found for list landing content"); Assert.AreEqual <int>(1, model.Items.Count, "Unexpected number of items in list landing content."); Assert.AreEqual <string>("listItem1", model.Items[0].Id); Assert.AreEqual <ContentType>(ContentType.ListItem, model.Items[0].ContentType); }
public void Edit_Test() { var mockRepo = new Mock <DevCmsDb>(); mockRepo.SetupDbSetMock(db => db.Content, GetContentList()); mockRepo.SetupDbSetMock(db => db.ContentTypes, GetContentTypeList2()); var controller = new ContentController(mockRepo.Object); var result = controller.Edit(1); var viewResult = Assert.IsType <ViewResult>(result); var model = Assert.IsAssignableFrom <EditContentDto>( viewResult.ViewData.Model); Assert.Equal(1, model.ContentTypeId); Assert.Equal(2, model.Attrs.Count); Assert.Equal(11, model.Attrs.First().AttributeId); Assert.Equal("test", model.Attrs.First().Value); Assert.Equal(1, model.Attrs.First().Id); Assert.Equal(1, model.Id); }
private ContentController CreateContentController(IDomainService domainService) { // We have to configure ILocalizedTextService to return a new string every time Localize is called // Otherwise it won't add the notification because it skips dupes var localizedTextServiceMock = new Mock <ILocalizedTextService>(); localizedTextServiceMock.Setup(x => x.Localize( It.IsAny <string>(), It.IsAny <string>(), It.IsAny <CultureInfo>(), It.IsAny <IDictionary <string, string> >())) .Returns(() => Guid.NewGuid().ToString()); var controller = new ContentController( Mock.Of <ICultureDictionary>(), NullLoggerFactory.Instance, Mock.Of <IShortStringHelper>(), Mock.Of <IEventMessagesFactory>(), localizedTextServiceMock.Object, new PropertyEditorCollection(new DataEditorCollection(() => null)), Mock.Of <IContentService>(), Mock.Of <IUserService>(), Mock.Of <IBackOfficeSecurityAccessor>(), Mock.Of <IContentTypeService>(), Mock.Of <IUmbracoMapper>(), Mock.Of <IPublishedUrlProvider>(), domainService, Mock.Of <IDataTypeService>(), Mock.Of <ILocalizationService>(), Mock.Of <IFileService>(), Mock.Of <INotificationService>(), new ActionCollection(() => null), Mock.Of <ISqlContext>(), Mock.Of <IJsonSerializer>(), Mock.Of <ICoreScopeProvider>(), Mock.Of <IAuthorizationService>(), Mock.Of <IContentVersionService>()); return(controller); }
public async Task PostSave_Simple_Invariant() { var content = GetMockedContent(); ApiController CtrlFactory(HttpRequestMessage message, IUmbracoContextAccessor umbracoContextAccessor, UmbracoHelper helper) { var contentServiceMock = Mock.Get(Current.Services.ContentService); contentServiceMock.Setup(x => x.GetById(123)).Returns(() => content); contentServiceMock.Setup(x => x.Save(It.IsAny <IContent>(), It.IsAny <int>(), It.IsAny <bool>())) .Returns(new OperationResult(OperationResultType.Success, new Core.Events.EventMessages())); //success var propertyEditorCollection = new PropertyEditorCollection(new DataEditorCollection(Enumerable.Empty <DataEditor>())); var controller = new ContentController( propertyEditorCollection, Factory.GetInstance <IGlobalSettings>(), umbracoContextAccessor, Factory.GetInstance <ISqlContext>(), Factory.GetInstance <ServiceContext>(), Factory.GetInstance <AppCaches>(), Factory.GetInstance <IProfilingLogger>(), Factory.GetInstance <IRuntimeState>(), helper, Factory.GetInstance <IScopeProvider>()); return(controller); } var runner = new TestRunner(CtrlFactory); var response = await runner.Execute("Content", "PostSave", HttpMethod.Post, content : GetMultiPartRequestContent(PublishJsonInvariant), mediaTypeHeader : new MediaTypeWithQualityHeaderValue("multipart/form-data"), assertOkResponse : false); Assert.AreEqual(HttpStatusCode.OK, response.Item1.StatusCode); var display = JsonConvert.DeserializeObject <ContentItemDisplay>(response.Item2); Assert.AreEqual(1, display.Variants.Count()); }
public void GetContentTest_View() { #region Setup Test Data var controller = new ContentController(); #endregion #region Execute Test var result = controller.GetContent(); #endregion #region Evaluate Results JsonResult jsonResult = (JsonResult)result; Assert.IsInstanceOfType(result, typeof(JsonResult), "Should return json result"); #endregion }
protected int SaveContentItem(ContentDejourInfo objContentDejour, bool update) { objContentDejour.Content = objContentDejour.DesktopHTML; objContentDejour.ContentKey = "mid=" + ModuleId.ToString() + "&KeyID=" + objContentDejour.KeyID.ToString(); objContentDejour.ContentTypeId = GetContentTypeID(); objContentDejour.ModuleID = ModuleId; objContentDejour.TabID = TabId; objContentDejour.Indexed = false; var cc = new ContentController(); var cdc = new ContentDejourController(); if (objContentDejour.ContentItemId == Null.NullInteger) { objContentDejour.ContentItemId = cc.AddContentItem(objContentDejour); cdc.LinkContentItem(objContentDejour.KeyID, objContentDejour.ContentItemId); } else if (update) { cc.UpdateContentItem(objContentDejour); } return(objContentDejour.ContentItemId); }
private int UpdateData() { int ContentTypeID = Convert.ToInt32(ddlContentTypes.SelectedValue); string Content = txtContents.Text; string ContentKey = txtContentKey.Text; string strIndexed = rdlIndexed.SelectedValue; bool Indexed = false; if (strIndexed == "1") { Indexed = true; } else { Indexed = false; } ContentController content_controller_obj = new ContentController(); int i = content_controller_obj.Edit(_idx, ContentTypeID, Content, ContentKey, Indexed); return(i); }
public void ContentController_AddContentItem_Sets_Override_CreatedByUserId_And_LastModifiedUserId() { // Arrange int expectedUserId = 5; Mock <IUserController> mockUserController = new Mock <IUserController>(); mockUserController.Setup(user => user.GetCurrentUserInfo()).Returns(new UserInfo { UserID = expectedUserId }); UserController.SetTestableInstance(mockUserController.Object); Mock <ICBO> mockCBO = new Mock <ICBO>(); CBO.SetTestableInstance(mockCBO.Object); Mock <IDataService> mockDataService = new Mock <IDataService>(); mockDataService.Setup(ds => ds.AddContentItem(It.IsAny <ContentItem>(), It.IsAny <int>())).Returns(Constants.CONTENT_AddContentItemId); ContentController controller = new ContentController(mockDataService.Object); ComponentFactory.RegisterComponentInstance <IContentController>(controller); ContentItem content = ContentTestHelper.CreateValidContentItem(); content.ContentItemId = Constants.CONTENT_ValidContentItemId; // Act int contentId = controller.AddContentItem(content); // Assert mockDataService.Verify( service => service.AddContentItem(It.IsAny <ContentItem>(), expectedUserId), Times.Once); // Cleanup UserController.ClearInstance(); CBO.ClearInstance(); }
public void ContentController_GetUnIndexedContentItems_Returns_List_Of_UnIndexedContentItems() { //Arrange Mock <IDataService> mockDataService = new Mock <IDataService>(); mockDataService.Setup(ds => ds.GetUnIndexedContentItems()).Returns(MockHelper.CreateValidContentItemsReader(Constants.CONTENT_IndexedFalseItemCount, Constants.CONTENT_IndexedFalse, Null.NullInteger, Null.NullString)); ContentController controller = new ContentController(mockDataService.Object); //Act IQueryable <ContentItem> contentItems = controller.GetUnIndexedContentItems(); //Assert Assert.AreEqual(Constants.CONTENT_IndexedFalseItemCount, contentItems.Count()); foreach (ContentItem content in contentItems) { Assert.IsFalse(content.Indexed); } }
public void Access_Allowed_By_Path() { //arrange var userMock = new Mock <IUser>(); userMock.Setup(u => u.Id).Returns(9); userMock.Setup(u => u.StartContentId).Returns(-1); var user = userMock.Object; var contentMock = new Mock <IContent>(); contentMock.Setup(c => c.Path).Returns("-1,1234,5678"); var content = contentMock.Object; var contentServiceMock = new Mock <IContentService>(); contentServiceMock.Setup(x => x.GetById(1234)).Returns(content); var contentService = contentServiceMock.Object; //act var result = ContentController.CheckPermissions(new Dictionary <string, object>(), user, null, contentService, 1234); //assert Assert.IsTrue(result); }
public void ContentController_AddContentItem_Sets_CreatedByUserId_And_LastModifiedUserId() { // Arrange Mock <IDataService> mockDataService = new Mock <IDataService>(); mockDataService.Setup(ds => ds.AddContentItem(It.IsAny <ContentItem>(), It.IsAny <int>())).Returns(Constants.CONTENT_AddContentItemId); ContentController controller = new ContentController(mockDataService.Object); ComponentFactory.RegisterComponentInstance <IContentController>(controller); ContentItem content = ContentTestHelper.CreateValidContentItem(); content.ContentItemId = Constants.CONTENT_ValidContentItemId; content.CreatedByUserID = 1; // Act int contentId = controller.AddContentItem(content); // Assert mockDataService.Verify( service => service.AddContentItem(It.IsAny <ContentItem>(), content.CreatedByUserID), Times.Once); }
public async Task PostSave_Validate_Existing_Content() { ApiController CtrlFactory(HttpRequestMessage message, IUmbracoContextAccessor umbracoContextAccessor, UmbracoHelper helper) { var contentServiceMock = Mock.Get(Current.Services.ContentService); contentServiceMock.Setup(x => x.GetById(123)).Returns(() => null); //do not find it var propertyEditorCollection = new PropertyEditorCollection(new DataEditorCollection(Enumerable.Empty <DataEditor>())); var controller = new ContentController( propertyEditorCollection, Factory.GetInstance <IGlobalSettings>(), umbracoContextAccessor, Factory.GetInstance <ISqlContext>(), Factory.GetInstance <ServiceContext>(), Factory.GetInstance <AppCaches>(), Factory.GetInstance <IProfilingLogger>(), Factory.GetInstance <IRuntimeState>(), helper, Factory.GetInstance <IScopeProvider>()); return(controller); } var runner = new TestRunner(CtrlFactory); var response = await runner.Execute("Content", "PostSave", HttpMethod.Post, content : GetMultiPartRequestContent(PublishJsonInvariant), mediaTypeHeader : new MediaTypeWithQualityHeaderValue("multipart/form-data"), assertOkResponse : false); Assert.AreEqual(HttpStatusCode.NotFound, response.Item1.StatusCode); Assert.AreEqual(")]}',\n{\"Message\":\"content was not found\"}", response.Item1.Content.ReadAsStringAsync().Result); //var obj = JsonConvert.DeserializeObject<PagedResult<UserDisplay>>(response.Item2); //Assert.AreEqual(0, obj.TotalItems); }
public void Only_Warns_About_Cultures_Being_Published() { var domainServiceMock = new Mock <IDomainService>(); domainServiceMock.Setup(x => x.GetAssignedDomains(It.IsAny <int>(), It.IsAny <bool>())) .Returns(new [] { new UmbracoDomain("/", "da-dk") }); Content rootNode = new ContentBuilder() .WithContentType(CreateContentType()) .WithId(1060) .AddContentCultureInfosCollection() .AddCultureInfos() .WithCultureIso("da-dk") .Done() .AddCultureInfos() .WithCultureIso("en-us") .Done() .AddCultureInfos() .WithCultureIso("se-sv") .Done() .AddCultureInfos() .WithCultureIso("de-de") .Done() .Done() .Build(); var culturesPublished = new [] { "en-us", "se-sv" }; var notifications = new SimpleNotificationModel(); ContentController contentController = CreateContentController(domainServiceMock.Object); contentController.AddDomainWarnings(rootNode, culturesPublished, notifications); // We only get two errors, one for each culture being published, so no errors from previously published cultures. Assert.AreEqual(2, notifications.Notifications.Count(x => x.NotificationType == NotificationStyle.Warning)); }
public void No_Access_To_Recycle_Bin_By_Permission() { //arrange var userMock = new Mock <IUser>(); userMock.Setup(u => u.Id).Returns(0); userMock.Setup(u => u.StartContentId).Returns(-1); var user = userMock.Object; var userServiceMock = new Mock <IUserService>(); var permissions = new List <EntityPermission> { new EntityPermission(9, 1234, new string[] { "A" }) }; userServiceMock.Setup(x => x.GetPermissions(user, -20)).Returns(permissions); var userService = userServiceMock.Object; //act var result = ContentController.CheckPermissions(new Dictionary <string, object>(), user, userService, null, -20, new[] { 'B' }); //assert Assert.IsFalse(result); }
public async Task PostSave_Validate_Variants_Empty_Name() { var content = GetMockedContent(); ApiController Factory(HttpRequestMessage message, UmbracoHelper helper) { var contentServiceMock = Mock.Get(Current.Services.ContentService); contentServiceMock.Setup(x => x.GetById(123)).Returns(() => content); contentServiceMock.Setup(x => x.Save(It.IsAny <IContent>(), It.IsAny <int>(), It.IsAny <bool>())) .Returns(new OperationResult(OperationResultType.Success, new Core.Events.EventMessages())); //success var propertyEditorCollection = new PropertyEditorCollection(new DataEditorCollection(Enumerable.Empty <DataEditor>())); var usersController = new ContentController(propertyEditorCollection); return(usersController); } //clear out one of the names var json = JsonConvert.DeserializeObject <JObject>(PublishJsonVariant); json["variants"].ElementAt(0)["name"] = null; var runner = new TestRunner(Factory); var response = await runner.Execute("Content", "PostSave", HttpMethod.Post, content : GetMultiPartRequestContent(JsonConvert.SerializeObject(json)), mediaTypeHeader : new MediaTypeWithQualityHeaderValue("multipart/form-data"), assertOkResponse : false); Assert.AreEqual(HttpStatusCode.BadRequest, response.Item1.StatusCode); var display = JsonConvert.DeserializeObject <ContentItemDisplay>(response.Item2); Assert.AreEqual(2, display.Errors.Count()); Assert.IsTrue(display.Errors.ContainsKey("Variants[0].Name")); Assert.IsTrue(display.Errors.ContainsKey("_content_variant_en-US_")); }
public async Task WhenValidParametersAreSupplied_ThenShouldReturnContentResult( [Frozen] Mock <IMediator> mediator, ContentController controller, GetContentQueryResult content, string type, string applicationId) { //arrange mediator.Setup(m => m.Send(It.Is <GetContentQuery>(q => q.Type == type && q.ApplicationId == applicationId), It.IsAny <CancellationToken>())) .ReturnsAsync(content); //act var query = new GetContentQuery { Type = type, ApplicationId = applicationId }; var result = await controller.Get(query, new CancellationToken()); //assert result.Should().BeOfType <ContentResult>(); ((ContentResult)result).Content.Should().Be(content.Content); }
public void No_Access_To_Root_By_Path() { //arrange var userMock = new Mock <IUser>(); userMock.Setup(u => u.Id).Returns(0); userMock.Setup(u => u.StartContentIds).Returns(new [] { 1234 }); var user = userMock.Object; var contentServiceMock = new Mock <IContentService>(); var contentService = contentServiceMock.Object; var userServiceMock = new Mock <IUserService>(); var userService = userServiceMock.Object; var entityServiceMock = new Mock <IEntityService>(); entityServiceMock.Setup(x => x.GetAllPaths(It.IsAny <UmbracoObjectTypes>(), It.IsAny <int[]>())) .Returns(new[] { Mock.Of <EntityPath>(entity => entity.Id == 1234 && entity.Path == "-1,1234") }); var entityService = entityServiceMock.Object; //act var result = ContentController.CheckPermissions(new Dictionary <string, object>(), user, userService, contentService, entityService, -1); //assert Assert.IsFalse(result); }
public void AddEntityWithDictionaryAttributeValue() { var dbMock = GetContentTypeListWithDictionaries(); var controller = new ContentController(dbMock.Object); var model = new AddEntityDto { Id = null,//new entity ContentTypeId = 1, Attrs = new List <AttributeValueDto> { new AttributeValueDto { AttributeId = 1, DictionaryItemId = 1, AttributeType = AttrType.Dictionary } } }; Assert.Equal(0, dbMock.Object.Content.Count()); var result = controller.Index(model); var viewResult = Assert.IsType <RedirectToActionResult>(result); Assert.Equal("Index", viewResult.ActionName); dbMock.Verify(db => db.SaveChanges(), Times.Once()); Assert.Equal(1, dbMock.Object.Content.Count()); var attrValues = dbMock.Object.Content.First().AttrValues; Assert.Single(attrValues); Assert.Equal(1, attrValues.First().DictionaryItemId); Assert.Null(attrValues.First().Value); }
public MenuItemRepository() { _ciCtrl = new ContentController(); _itemContentTypeId = getContentType(); }
public static ContentController Fixture() { ContentController controller = new ContentController(new ContentRepository(), "", new LoginView()); return(controller); }
public void Controller_Content_InvalidCharset_DefaultEncodingIsUsed() { // Arrange var contentController = new ContentController(); var contentType = "text/xml; charset=invalid; p1=p1-value"; // Act var contentResult = (ContentResult)contentController.Content_WithInvalidCharset(); // Assert Assert.NotNull(contentResult.ContentType); Assert.Equal(contentType, contentResult.ContentType.ToString()); // The default encoding of ContentResult is used when this result is executed. Assert.Null(contentResult.ContentType.Encoding); }
public void Controller_Content_CharsetInContentType_IsUsedForEncoding() { // Arrange var contentController = new ContentController(); var contentType = MediaTypeHeaderValue.Parse("text/xml; charset=us-ascii; p1=p1-value"); // Act var contentResult = (ContentResult)contentController.Content_WithEncodingInCharset(); // Assert Assert.Equal(contentType, contentResult.ContentType); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here // The services are stored in Game.Services to make them accessible by all // game components. _spriteBatch = new SpriteBatch(GraphicsDevice); Services.AddService(typeof(SpriteBatch), _spriteBatch); Services.AddService(typeof(ContentManager), Content); // Add the input service, which manages device input, button presses, etc. _inputManager = new InputManager(false); Services.AddService(typeof(IInputService), _inputManager); // Add the UI service, which manages UI screens. _uiManager = new UIManager(this, _inputManager); Services.AddService(typeof(IUIService), _uiManager); // Add the animation service. _animationManager = new AnimationManager(); Services.AddService(typeof(IAnimationService), _animationManager); _consoleManager = new ConsoleManager(); Services.AddService(typeof(ConsoleManager), _consoleManager); _contentController = new ContentController(GraphicsDevice, Content); _contentController.LoadContent(); Services.AddService(typeof(ContentController), _contentController); _gameContentManager = new GameContentManager(Services); _gameContentManager.LoadGameContent(); Services.AddService(typeof(GameContentManager), _gameContentManager); _galaxyManager = new GalaxyManager(Services); Services.AddService(typeof(GalaxyManager), _galaxyManager); _gameManager = new GameManager(Services); _gameManager.NewGame(); Services.AddService(typeof(GameManager), _gameManager); _eventManager = new EventManager(); Services.AddService(typeof(EventManager), _eventManager); // ----- Add GameComponents // The component that shows the individual screen. Components.Add(new CentauriGame(this)); base.Initialize(); }
/// <summary> /// Zooms out on the document preview. /// </summary> /// <param name="sender">The control calling this action.</param> partial void ZoomOut(Foundation.NSObject sender) { ContentController.ZoomOut(); }
/// <summary> /// Scrolls the preview document to bottom. /// </summary> /// <param name="sender">Sender.</param> partial void ScrollToBottom(Foundation.NSObject sender) { ContentController.ScrollToBottom(); }
public static ContentController Fixture() { ContentController controller = new ContentController(new ContentRepository(), "", new LoginView()); return controller; }
public void Controller_Content_NoContentType_DefaultEncodingIsUsed() { // Arrange var contentController = new ContentController(); var expected = MediaTypeHeaderValue.Parse("text/plain; charset=utf-8"); // Act var contentResult = (ContentResult)contentController.Content_WithNoEncoding(); // Assert // The default content type of ContentResult is used when the result is executed. Assert.Null(contentResult.ContentType); }
public void ReformatDocumentAsMarkDown(NSObject sender) { ContentController.SetLanguageToMarkDown(); }
public BuildingCellTile(ContentController content, SpriteBatch spritebatch, BuildingCellViewModel buildingCell) { _spritebatch = spritebatch; _buildingCell = buildingCell; _testTexture = content.GetContent<Texture2D>("StarFields/test"); _testTexture2 = content.GetContent<Texture2D>("SystemMap/Planet1"); }
private void LoadServices(IServiceProvider services) { _content = (ContentController)services.GetService(typeof(ContentController)); _gameManager = (GameManager)services.GetService(typeof(GameManager)); }
public void ReformatDocumentAsXML(NSObject sender) { ContentController.SetLanguageToXML(); }
private Controller() { ContentController = new ContentController(); }
public GalaxyManager(IServiceProvider services) { _content = (ContentController)services.GetService(typeof(ContentController)); _gameContentManager = (GameContentManager)services.GetService(typeof(GameContentManager)); }
public void PrintDocument(NSObject sender) { ContentController.PrintDocument(PrintInfo); }
private ContentWorkflowController() { contentController = new ContentController(); }
public GameScreenBase(IServiceProvider services) { _content = (ContentController)services.GetService(typeof(ContentController)); _gameManager = (GameManager)services.GetService(typeof(GameManager)); }
/// <summary> /// Returns the document preview to its original size. /// </summary> /// <param name="sender">The control calling this action.</param> partial void OriginalSize(Foundation.NSObject sender) { ContentController.OriginalSize(); }
public ContentTabStateManager(ContentController contentController) { _contentController = contentController; }
public void PrintDocument(NSObject sender) { ContentController.PrintPreview(); }
public ContentControllerTest() { contentRepo = Substitute.For <IRepository <Content> >(); underTest = new ContentController(contentRepo); }