public void LoadObjects()
        {
            _loadedObjectDataStub1.Stub(stub => stub.ObjectID).Return(DomainObjectIDs.Order1);
            _loadedObjectDataStub2.Stub(stub => stub.ObjectID).Return(DomainObjectIDs.Order3);

            _persistenceStrategyMock
            .Expect(mock => mock.LoadObjectData(
                        Arg <ICollection <ObjectID> > .List.Equal(new[] { DomainObjectIDs.Order1, DomainObjectIDs.Order3 })))
            .Return(new[] { _loadedObjectDataStub1, _loadedObjectDataStub2 });
            _loadedObjectDataRegistrationAgentMock
            .Expect(mock => mock.RegisterIfRequired(
                        Arg <IEnumerable <ILoadedObjectData> > .List.Equal(new[] { _loadedObjectDataStub1, _loadedObjectDataStub2 }),
                        Arg.Is(true)));

            _mockRepository.ReplayAll();

            var result = _objectLoader.LoadObjects(new[] { DomainObjectIDs.Order1, DomainObjectIDs.Order3 }, true);

            _mockRepository.VerifyAll();
            Assert.That(result, Is.EqualTo(new[] { _loadedObjectDataStub1, _loadedObjectDataStub2 }));
        }
Ejemplo n.º 2
0
 // Start is called before the first frame update
 private void Start()
 {
     objectHolder = Instantiate(objectHolder);
     objectHolder.LoadObjects();
 }