public InteractionsControllerTests() { mockListInteractionsUseCase = new Mock <IListInteractions>(); mockListInteractionsAndChildInteractionsUseCase = new Mock <IListInteractionsAndChildInteractions>(); interactionsController = new InteractionsController( mockListInteractionsUseCase.Object, mockListInteractionsAndChildInteractionsUseCase.Object); }
private void OnTriggerExit2D(Collider2D collision) { if (!interactAutomatically) { return; } InteractionsController interactionController = collision.GetComponent <InteractionsController>(); if (interactionController != null) { EndInteract(interactionController.character); } }
public void BulkInteractionImportShouldCreateNewInteractionChannelWithChannelTypeMediumValueId() { var interactionChannelForeignKey = Guid.NewGuid().ToString(); var expectedChannelTypeMediumValueId = new DefinedValueService(new RockContext()).Get(SystemGuid.DefinedValue.INTERACTIONCHANNELTYPE_CONTENTCHANNEL.AsGuid()).Id; var controller = new InteractionsController(); var interactionsImport = new InteractionsImport { Interactions = new List <InteractionImport> { new InteractionImport { InteractionChannelForeignKey = interactionChannelForeignKey, InteractionChannelName = $"Test Channel Name {nameof(BulkInteractionImportShouldCreateNewInteractionChannelWithChannelTypeMediumValueId)}", InteractionChannelChannelTypeMediumValueId = expectedChannelTypeMediumValueId, InteractionComponentId = 17, Interaction = new InteractionImportInteraction { Operation = "Test Operation", InteractionDateTime = RockDateTime.Now, InteractionSummary = $"Test Summary {nameof(BulkInteractionImportShouldCreateNewInteractionChannelWithChannelTypeMediumValueId)}", InteractionData = $"Test Data {nameof(BulkInteractionImportShouldCreateNewInteractionChannelWithChannelTypeMediumValueId)}", ForeignKey = interactionChannelForeignKey } } } }; controller.InteractionImport(interactionsImport); var validationQuery = $"SELECT * FROM InteractionChannel WHERE ForeignKey = '{interactionChannelForeignKey}'"; var result = new RockContext().Database.SqlQuery <Rock.Model.InteractionChannel>(validationQuery).ToListAsync().Result; Assert.That.IsNotNull(result); Assert.That.IsTrue(result.Count > 0); Assert.That.AreEqual(expectedChannelTypeMediumValueId, result[0].ChannelTypeMediumValueId); validationQuery = $"SELECT * FROM Interaction WHERE ForeignKey = '{interactionChannelForeignKey}'"; var interactionResult = new RockContext().Database.SqlQuery <Interaction>(validationQuery).ToListAsync().Result; Assert.That.IsNotNull(interactionResult); Assert.That.IsTrue(interactionResult.Count > 0); }
public void BulkInteractionImportShouldCreateNewInteractionChannelWithNoChannelTypeMediumValue() { var interactionChannelForeignKey = Guid.NewGuid().ToString(); var controller = new InteractionsController(); var interactionsImport = new InteractionsImport { Interactions = new List <InteractionImport> { new InteractionImport { InteractionChannelForeignKey = interactionChannelForeignKey, InteractionChannelName = $"Test Channel Name {nameof(BulkInteractionImportShouldCreateNewInteractionChannelWithNoChannelTypeMediumValue)}", InteractionComponentId = 17, Interaction = new InteractionImportInteraction { Operation = "Test Operation", InteractionDateTime = RockDateTime.Now, InteractionSummary = $"Test Summary {nameof(BulkInteractionImportShouldCreateNewInteractionChannelWithNoChannelTypeMediumValue)}", InteractionData = $"Test Data {nameof(BulkInteractionImportShouldCreateNewInteractionChannelWithNoChannelTypeMediumValue)}", ForeignKey = interactionChannelForeignKey } } } }; controller.InteractionImport(interactionsImport); var validationQuery = $"SELECT * FROM InteractionChannel WHERE ForeignKey = '{interactionChannelForeignKey}'"; var result = new RockContext().Database.SqlQuery <Rock.Model.InteractionChannel>(validationQuery).ToListAsync().Result; Assert.That.IsNotNull(result); Assert.That.IsTrue(result.Count > 0); validationQuery = $"SELECT * FROM Interaction WHERE ForeignKey = '{interactionChannelForeignKey}'"; var interactionResult = new RockContext().Database.SqlQuery <Interaction>(validationQuery).ToListAsync().Result; Assert.That.IsNotNull(interactionResult); Assert.That.IsTrue(interactionResult.Count > 0); }
private void Start() { instance = this; }
public void TestInitialize() { _interactionsController = new InteractionsController(_mockRepo.Object, _mockMapper.Object, _mockHub.Object); }