Esempio n. 1
0
 public override void Given()
 {
     m1MessageView = Moq.Mock <IMessageView>();
     m2MessageView = Moq.Mock <IMessageView>();
     part          = New.Part().WithMessageMaps(x => x.WithName("m1").CanBuildMessageView(() => m1MessageView),
                                                x => x.WithName("m2").CanBuildMessageView(() => m2MessageView)).Build();
 }
        public override void Given()
        {
            view = Moq.Mock <IEntityView>();

            presentationModel = Moq.Mock <IPresentationModel>();
            presentationModel.SetupGet(x => x.Title).Returns("aaaaa");
        }
Esempio n. 3
0
        public override void Given()
        {
            base.Given();
            screenToOpen = new Mock <IScreen>().Object;

            screenSubject = Moq.Mock <IScreenSubject>();
            screenSubject.Setup(x => x.CreateScreen(screenFactory)).Returns(screenToOpen);
        }
 public override void Given()
 {
     base.Given();
     partPresenters = new[] { Moq.Mock <IPartPresenter>(), Moq.Mock <IPartPresenter>(), Moq.Mock <IPartPresenter>() };
     partPresenters[0].Setup(x => x.CanClose()).Returns(true);
     partPresenters[1].Setup(x => x.CanClose()).Returns(false);
     partPresenters[2].Setup(x => x.CanClose()).Returns(true);
 }
        public override void Given()
        {
            needRegionManagerScreen = Moq.Mock <INeedRegionManager>();

            localRegionManager = Moq.Mock <IRegionManager>();
            mainRegion.Setup(x => x.Add(It.IsAny <object>(), It.IsAny <string>(), true))
            .Returns(localRegionManager);
        }
        public override void Given()
        {
            someEntity = new SomeEntity();
            someEntity.Screen_Name_To_Return = "Sreen";

            entityView = Moq.Mock <IEntityView <SomeEntity> >();

            partPresenters = new[] { Moq.Mock <IPartPresenter>() };
        }
        public override void Given()
        {
            messageSender = Moq.Mock <IMessageSender>();

            var messageMap = Moq.Mock <IMessageMap_v2>();

            messageMap.SetupGet(x => x.MessageType).Returns(typeof(ChangeOrderAttributes));

            viewModel = new MessageMapViewModel(messageSender, messageMap);
        }
        public override void Given()
        {
            base.Given();

            var activeScreen = screenToOpen = new Mock <IScreen>().Object;

            screenSubject = Moq.Mock <IScreenSubject>();
            screenSubject.Setup(x => x.Matches(activeScreen)).Returns(true);

            screenCollection.SetupGet(x => x.Active).Returns(activeScreen);
        }
        public override void Given()
        {
            base.Given();
            inActiveScreen = newScreen = Moq.Mock <IScreen>();

            screenSubject = Moq.Mock <IScreenSubject>();
            screenSubject.Setup(x => x.Matches(inActiveScreen)).Returns(true);

            var someOtherScreen = Moq.Stub <IScreen>();

            screenCollection.Setup(x => x.Active).Returns(someOtherScreen);
            screenCollection.SetupGet(x => x.AllScreens).Returns(new[] { someOtherScreen, inActiveScreen });
        }
Esempio n. 10
0
        public override void Given()
        {
            base.Given();



            messageMap = New.MessageMap_v2("Change Order Attributes")
                         .Fields(x => x.Label("Ref.").Value("PO001"),
                                 x => x.Label("Order Date").Value(new DateTime(2010, 1, 12))).Build();
            var fieldV2s = messageMap.Fields.ToList();

            fieldViewModelLocator = Moq.Mock <IFieldViewModelLocator>();
            fieldViewModelLocator.Setup(x => x.GetViewModel(fieldV2s[0]))
            .Returns((IField_v2 x) => new MessageValueFieldViewModel <string>(x));
            fieldViewModelLocator.Setup(x => x.GetViewModel(fieldV2s[1]))
            .Returns((IField_v2 x) => new MessageValueFieldViewModel <DateTime>(x));
        }
        public override void Given()
        {
            base.Given();

            messageMap = New.MessageMap_v2("Supplier")
                         .Fields(x => x.Label("Supplier Name")
                                 .Value(new Supplier()
            {
                Name = "Elgar"
            })
                                 ).Build();
            var fieldV2s = messageMap.Fields.ToList();

            var lookUpDataProvider = Moq.Mock <ILookUpDataProvider>();

            lookUpDataProvider.Setup(x => x.GetLookupData <Supplier>())
            .Returns(new[]
            {
                new Supplier()
                {
                    Name = "Elgar"
                },
                new Supplier()
                {
                    Name = "Supplier2"
                },
                new Supplier()
                {
                    Name = "Supplier3"
                }
            });

            fieldViewModelLocator = Moq.Mock <IFieldViewModelLocator>();
            fieldViewModelLocator.Setup(x => x.GetViewModel(fieldV2s[0]))
            .Returns((IField_v2 x) => new MessageReferenceFieldViewModel <Supplier>(x, lookUpDataProvider));
        }
Esempio n. 12
0
 public override void Given()
 {
     partVM = Moq.Mock <IPartViewModel>();
 }
Esempio n. 13
0
 public override void Given()
 {
     base.Given();
     screenFactory = Moq.Mock <IScreenFactory>();
 }
Esempio n. 14
0
 protected With_Empty_Screens()
 {
     mainRegion       = Moq.Mock <IRegion>();
     screenCollection = new ScreenCollection(mainRegion);
 }
Esempio n. 15
0
 public With_Context()
 {
     partView = Moq.Mock <IEntityPartView>();
 }
Esempio n. 16
0
 public override void Given()
 {
     screenCollection     = Moq.Mock <IScreenCollection>();
     screenObjectRegistry = Moq.Mock <IScreenObjectRegistry>();
     screenFactory        = Moq.Mock <IScreenFactory>();
 }
Esempio n. 17
0
 public override void Given()
 {
     view = Moq.Mock <IPartView>();
 }
Esempio n. 18
0
 public override void Given()
 {
     screen = Moq.Mock <IScreen>();
     screen.Moq().SetupGet(x => x.View).Returns(new object());
 }
Esempio n. 19
0
 public override void Given()
 {
     view = Moq.Mock <IPresentationView>();
 }
Esempio n. 20
0
 public override void Given()
 {
     messageMap = Moq.Mock <IMessageMap_v2>();
 }