public NakedObjectsFramework(IMessageBroker messageBroker,
                              ISession session,
                              ILifecycleManager lifecycleManager,
                              IServicesManager servicesManager,
                              INakedObjectManager nakedObjectManager,
                              IObjectPersistor persistor,
                              IReflector reflector,
                              IMetamodelManager metamodelManagerManager,
                              IContainerInjector containerInjector,
                              NakedObjectFactory nakedObjectFactory,
                              SpecFactory memberFactory,
                              ITransactionManager transactionManager,
                              IFrameworkResolver frameworkResolver)
 {
     this.messageBroker           = messageBroker;
     this.session                 = session;
     this.lifecycleManager        = lifecycleManager;
     this.servicesManager         = servicesManager;
     this.nakedObjectManager      = nakedObjectManager;
     this.persistor               = persistor;
     this.reflector               = reflector;
     this.metamodelManagerManager = metamodelManagerManager;
     this.containerInjector       = containerInjector;
     this.transactionManager      = transactionManager;
     this.frameworkResolver       = frameworkResolver;
     containerInjector.Framework  = this;
     memberFactory.Initialize(this);
     nakedObjectFactory.Initialize(metamodelManagerManager, session, lifecycleManager, persistor, nakedObjectManager);
 }
Esempio n. 2
0
 public NakedObjectsFramework(IMessageBroker messageBroker,
                              ISession session,
                              ILifecycleManager lifecycleManager,
                              IServicesManager servicesManager,
                              INakedObjectManager nakedObjectManager,
                              IObjectPersistor persistor,
                              IReflector reflector,
                              IMetamodelManager metamodelManagerManager,
                              IDomainObjectInjector domainObjectInjector,
                              NakedObjectFactory nakedObjectFactory,
                              SpecFactory memberFactory,
                              ITransactionManager transactionManager,
                              IFrameworkResolver frameworkResolver,
                              ILoggerFactory loggerFactory)
 {
     MessageBroker                  = messageBroker;
     Session                        = session;
     LifecycleManager               = lifecycleManager;
     ServicesManager                = servicesManager;
     NakedObjectManager             = nakedObjectManager;
     Persistor                      = persistor;
     Reflector                      = reflector;
     MetamodelManager               = metamodelManagerManager;
     DomainObjectInjector           = domainObjectInjector;
     TransactionManager             = transactionManager;
     FrameworkResolver              = frameworkResolver;
     domainObjectInjector.Framework = this;
     memberFactory.Initialize(this, loggerFactory, loggerFactory.CreateLogger <SpecFactory>());
     nakedObjectFactory.Initialize(metamodelManagerManager, session, lifecycleManager, persistor, nakedObjectManager, loggerFactory);
 }
Esempio n. 3
0
 private void ValidateSpecFactory(string preconditionMessage, string behaviourMessage, string assertionMessage)
 {
     SpecFactory.Received(1).CreateAssertable(
         Arg.Is <Action>(arg => ValidatePrecondition(arg, preconditionMessage)),
         Arg.Is <Action <object> >(arg => ValidateBehaviour(arg, behaviourMessage)),
         Arg.Is <Action <object> >(arg => ValidateAssertion(arg, assertionMessage)));
 }
        public MetamodelManager(SpecFactory specFactory, IMetamodel metamodel)
        {
            Assert.AssertNotNull(specFactory);
            Assert.AssertNotNull(metamodel);

            this.specFactory = specFactory;
            this.metamodel   = metamodel;
        }
Esempio n. 5
0
 private void ValidateSpecFactory(string behaviourMessage, string preconditionData)
 {
     // Validate that both precondition and behaviour have been passed to
     // the SpecFactory.
     SpecFactory.Received(1).CreateAssertionSpec(
         Arg.Is <Func <string> >(arg => ValidatePrecondition(arg, preconditionData)),
         Arg.Is <Action <object, string> >(arg => ValidateBehaviour(arg, behaviourMessage, preconditionData)));
 }
Esempio n. 6
0
        private bool ValidateSpecFactoryWithAction(string preconditionMessage, string behaviourMessage)
        {
            SpecFactory.Received(1).CreateAssertionSpec(
                Arg.Is <Action>(arg => ValidatePreconditionWithMessage(arg, preconditionMessage)),
                Arg.Is <Action <object> >(arg => ValidateBehaviourWithMessage(arg, behaviourMessage)));

            return(true);
        }
Esempio n. 7
0
        /// <summary>
        /// Instantiates a new BehaviourSpecTests object.
        /// </summary>
        /// <param name="fixture"></param>
        public BehaviourSpec_DataTests(SpecFactoryFixture fixture)
        {
            if (fixture == null)
            {
                throw new ArgumentNullException(nameof(fixture));
            }

            SpecFactory = fixture.SpecFactory;

            // Returns a mocked AssertionSpec
            SpecFactory.CreateAssertionSpec(null, null).ReturnsForAnyArgs(fixture.AssertionSpec);

            Events = new Dictionary <string, string>();
        }
Esempio n. 8
0
        /// <summary>
        /// Instantiates a new AssertionSpecTests object.
        /// </summary>
        /// <param name="fixture"></param>
        public AssertableTests(SpecFactoryFixture fixture)
        {
            if (fixture == null)
            {
                throw new ArgumentNullException(nameof(fixture));
            }

            SpecFactory = fixture.SpecFactory;

            // Returns a mocked AssertionSpec and a mocked Assertable fixture object.
            SpecFactory.CreateAssertionSpec(null, null).ReturnsForAnyArgs(fixture.AssertionSpec);
            SpecFactory.CreateAssertable(null, null, null).ReturnsForAnyArgs(fixture.Assertable);

            Events = new Dictionary <string, string>();
        }
Esempio n. 9
0
    protected void grdDetails_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        Control control = e.Row.FindControl("lblCheckDetailList");

        if (control != null)
        {
            string checkstatus = (control as Label).Text;
            if (!String.IsNullOrEmpty(checkstatus))
            {
                control = e.Row.FindControl("rptDetail");
                if (control != null)
                {
                    (control as Repeater).DataSource = SpecFactory.GetJobDetails(checkstatus);
                    (control as Repeater).DataBind();
                }
            }
        }
    }
Esempio n. 10
0
 public LanguageBlockDeserializer(INodeDeserializer next)
 {
     _Next    = next;
     _Factory = new SpecFactory();
 }
Esempio n. 11
0
 public void Dispose()
 {
     SpecFactory.ClearReceivedCalls();
     Events.Clear();
 }
 public MetamodelManager(SpecFactory specFactory, IMetamodel metamodel)
 {
     this.specFactory = specFactory ?? throw new InitialisationException($"{nameof(specFactory)} is null");
     Metamodel        = metamodel ?? throw new InitialisationException($"{nameof(metamodel)} is null");
 }