Content Studio Web Content Management System
SystemObject
ContentStudio.EventActions.SynchronousEventHandlers.SpotlijsterEventSpotter
Assembly: EventHandlers.Spotlijster (in EventHandlers.Spotlijster.dll) Version: 1.0.0.0 (1.0.0.0)
Top
Top
Top
[This is preliminary documentation and is subject to change.]
Contains methods to generate (mocked) sample data for a
Content Studio synchronous event handler and activate your
handler implementation so it can be tested and debugged outside of Content Studio.
Unlike more sophisticated mockers this implementation does not let you control
the exact content of the data sent to the event handler by Content Studio.
Inheritance Hierarchy
ContentStudio.EventActions.SynchronousEventHandlers.SpotlijsterEventSpotter
Namespace: ContentStudio.EventActions.SynchronousEventHandlers.Spotlijster
Assembly: EventHandlers.Spotlijster (in EventHandlers.Spotlijster.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
The EventSpotter type exposes the following members.
Constructors
Name | Description | |
---|---|---|
EventSpotter | Initializes a new instance of the EventSpotter class |
Methods
Name | Description | |
---|---|---|
ActivateWithEptdocumentTEventHandler(TEventHandler, String, String) |
Activates a Content Studio version 5.2 and earlier synchronous event handler with sample data generated for an ept document and the
TEventHandler type of event handler.
This handler must implement the ICSEventHandler and ISingleSynchronousHandler interfaces.
| |
ActivateWithEptdocumentTEventHandler(TEventHandler, Int32, String, String) |
Activates a Content Studio version 5.2 and earlier synchronous event handler with sample data generated for an ept document and the
TEventHandler type of event handler.
| |
ActivateWithEptdocumentTEventHandler(TEventHandler, String, String, String) |
Activates a Content Studio version 5.2 and earlier synchronous event handler with sample data generated for an ept document and the
TEventHandler type of event handler.
| |
ActivateWithEptdocument2TEventHandler(TEventHandler, String, String) |
Activates a Content Studio version 5.3 and later synchronous event handler with sample data generated for an ept document and the
TEventHandler type of event handler.
This handler must implement the ICSEventHandler2 and ISingleSynchronousHandler interfaces.
| |
ActivateWithEptdocument2TEventHandler(TEventHandler, Int32, String, String) |
Activates a Content Studio version 5.3 and later synchronous event handler with sample data generated for an ept document and the
TEventHandler type of event handler.
| |
ActivateWithEptdocument2TEventHandler(TEventHandler, String, String, String) |
Activates a Content Studio version 5.3 and later synchronous event handler with sample data generated for an ept document and the
TEventHandler type of event handler.
| |
Equals | (Inherited from Object.) | |
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
ToString | (Inherited from Object.) |
Fields
Name | Description | |
---|---|---|
EptDocumentTypeValue |
Represents the numeric value of a Content Studio ept document type.
|
Examples
This sample shows a very simple test project that invokes an event handler with Asserts.
C#
using System; using ContentStudio.EventActions.SynchronousEventHandlers; using ContentStudio.EventActions.SynchronousEventHandlers.Spotlijster; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace TestOfSyncHandlers { //This represents the event handler you would like to test public class OnBeforeDocumentSaveImpl : BeforeDocumentSaveSyncHandler { protected override void DoWork() { //Your code goes here } //If your event handler needs some clean up, it should be done //in the overridable Dispose method. protected override void Dispose(bool disposing) { //Your cleanup code goes here base.Dispose(disposing); } } //Code for testing an event handler outside of Content Studio [TestClass] public class TestMethods { [TestMethod] public void TestBeforeDocumentSave() { using (var handler = new BeforeDocumentSaveImpl()) { var activator = new EventSpotter(); //Activate the event handler, this will call your implementation //with mocked data so the handler can be tested and debugged. activator.ActivateWithEptdocument2(handler, "OnBeforeDocumentSave", null, null); //Do some asserts Assert.IsFalse(String.IsNullOrEmpty(handler.Content as string)); Assert.IsNotNull(handler.EptContent); Assert.IsTrue(handler.EptContent.Count > 0); } } } }
See Also