protected override void OnSetup()
		{
			base.OnSetup();
			_transport = TransportMock.CreateWithoutStructureMapClear(typeof(SearcherProfile).Assembly, new[] { typeof(SearcherProfile).Assembly }, new Assembly[] { });
			_generals = new[]
				{
					new GeneralDTO {ID = 2, Name = "Second general", EntityTypeID = QueryEntityTypeProvider.USERSTORY_TYPE_ID, ParentProjectID = 1},
					new GeneralDTO {ID = 3, Name = "Third general", EntityTypeID = QueryEntityTypeProvider.BUG_TYPE_ID, ParentProjectID = 1},
					new GeneralDTO {ID = 7, Name = "First Test Case", EntityTypeID = QueryEntityTypeProvider.TESTCASE_TYPE_ID, ParentProjectID = 1}
				};

			_comments = new[]
				{
					new CommentDTO {GeneralID = 2, CommentID = 1, Description = "FirstDescription"},
				};

			_testSteps = new[]
			{
				new TestStepDTO
				{
					ID = 2,
					Description = "First Test Step Description",
					Result = "First Test Step Result",
					TestCaseID = 7
				}
			};

			_transport.On<GeneralQuery>().Reply(x => ReplyOnEntityQuery<GeneralQuery, GeneralDTO, GeneralQueryResult>(x, _generals));
			_transport.On<AssignableQuery>().Reply(x => ReplyOnAssignableQuery(x, new AssignableDTO[]{}));
			_transport.On<ImpedimentQuery>().Reply(x => new ImpedimentQueryResult { Dtos = new ImpedimentDTO[] { }, QueryResultCount = 0, TotalQueryResultCount = 0, FailedDtosCount = 0 });
			_transport.On<ReleaseProjectQuery>().Reply(x => new ReleaseProjectQueryResult { Dtos = new ReleaseProjectDTO[] { }, QueryResultCount = 0, TotalQueryResultCount = 0, FailedDtosCount = 0 });
			_transport.On<RetrieveAllAssignableSquadsQuery>().Reply(x => new AssignableSquadQueryResult { Dtos = new AssignableSquadDTO[] { }, QueryResultCount = 0, TotalQueryResultCount = 0, FailedDtosCount = 0 });
			_transport.On<CommentQuery>().Reply(x => ReplyOnEntityQuery<CommentQuery, CommentDTO, CommentQueryResult>(x, _comments));
			_transport.On<TestStepQuery>().Reply(x => ReplyOnEntityQuery<TestStepQuery, TestStepDTO, TestStepQueryResult>(x, _testSteps));
		}
        protected override void OnSetup()
        {
            base.OnSetup();
            _transport = TransportMock.CreateWithoutStructureMapClear(typeof(SearcherProfile).Assembly, new[] { typeof(SearcherProfile).Assembly }, new Assembly[] { });
            _generals = new[]
                {
                    new GeneralDTO {ID = 1, Name = "First general", EntityTypeID = 4, ParentProjectID = 1},
                    new GeneralDTO {ID = 2, Name = "Second general", EntityTypeID = QueryEntityTypeProvider.USERSTORY_TYPE_ID, ParentProjectID = 1},
                    new GeneralDTO {ID = 3, Name = "Third general", EntityTypeID = QueryEntityTypeProvider.BUG_TYPE_ID, ParentProjectID = 1},
                    new GeneralDTO {ID = 4, Name = "Fourth general", EntityTypeID = QueryEntityTypeProvider.TESTCASE_TYPE_ID, ParentProjectID = 1}
                };

            _comments = new[]
                {
                    new CommentDTO {GeneralID = 1, CommentID = 1, Description = "FirstDescription"},
                    new CommentDTO {GeneralID = 2, CommentID = 2, Description = "SecondDescription"}
                };

            _assignables = new[]
                {
                    new AssignableDTO {ID = 2, EntityStateID = 11, SquadID = 10, ProjectID = 1, EntityTypeID = QueryEntityTypeProvider.USERSTORY_TYPE_ID},
                    new AssignableDTO {ID = 3, EntityStateID = 12, SquadID = 11, ProjectID = 1, EntityTypeID = QueryEntityTypeProvider.BUG_TYPE_ID}
                };
            _testCases = new[] { new TestCaseDTO { ID = 4, Success = "Success step", Steps = "Steps", ProjectID = 1, EntityTypeID=QueryEntityTypeProvider.TESTCASE_TYPE_ID } };

            _transport.On<GeneralQuery>().Reply(x => ReplyOnEntityQuery<GeneralQuery, GeneralDTO, GeneralQueryResult>(x, _generals));
            _transport.On<CommentQuery>().Reply(x => ReplyOnEntityQuery<CommentQuery, CommentDTO, CommentQueryResult>(x, _comments));
            _transport.On<TestCaseQuery>().Reply(x => ReplyOnEntityQuery<TestCaseQuery, TestCaseDTO, TestCaseQueryResult>(x, _testCases));
            _transport.On<ImpedimentQuery>().Reply(x => new ImpedimentQueryResult { Dtos = new ImpedimentDTO[] { }, QueryResultCount = 0, TotalQueryResultCount = 0, FailedDtosCount = 0 });
            _transport.On<AssignableQuery>().Reply(x => ReplyOnAssignableQuery(x, _assignables));
        }
		protected override void OnSetup()
		{
			base.OnSetup();
			_transport = TransportMock.CreateWithoutStructureMapClear(typeof(SearcherProfile).Assembly, new[] { typeof(SearcherProfile).Assembly }, new Assembly[] { });
			_generals = new[]
				{
					new GeneralDTO {ID = 2, Name = "Second general", EntityTypeID = QueryEntityTypeProvider.USERSTORY_TYPE_ID, ParentProjectID = 1},
					new GeneralDTO {ID = 3, Name = "Third general", EntityTypeID = QueryEntityTypeProvider.BUG_TYPE_ID, ParentProjectID = 1},
					new GeneralDTO {ID = 4, Name = "Fourth general", EntityTypeID = QueryEntityTypeProvider.BUG_TYPE_ID, ParentProjectID = 2},
				};

			_assignables = new[]
				{
					new AssignableDTO {ID = 2, EntityStateID = 11, SquadID = 10, ProjectID = 1, EntityTypeID = QueryEntityTypeProvider.USERSTORY_TYPE_ID},
					new AssignableDTO {ID = 3, EntityStateID = 12, SquadID = 11, ProjectID = 1, EntityTypeID = QueryEntityTypeProvider.BUG_TYPE_ID},
					new AssignableDTO {ID = 4, EntityStateID = 12, SquadID = 11, ProjectID = 2, EntityTypeID = QueryEntityTypeProvider.BUG_TYPE_ID}
				};

			_transport.On<GeneralQuery>().Reply(x => ReplyOnEntityQuery<GeneralQuery, GeneralDTO, GeneralQueryResult>(x, _generals));

			_transport.On<AssignableQuery>().Reply(x => ReplyOnAssignableQuery(x, _assignables));
			
			_transport.On<CommentQuery>().Reply(x => new CommentQueryResult{Dtos = new CommentDTO[]{}, QueryResultCount = 0, TotalQueryResultCount = 0, FailedDtosCount = 0});

			_transport.On<TestStepQuery>().Reply(x => new TestStepQueryResult { Dtos = new TestStepDTO[] { }, QueryResultCount = 0, TotalQueryResultCount = 0, FailedDtosCount = 0 });

		}
		protected override void OnSetup()
		{
			base.OnSetup();
			_transport = TransportMock.CreateWithoutStructureMapClear(typeof(SearcherProfile).Assembly, new[] { typeof(SearcherProfile).Assembly }, new Assembly[] { });
			_assignables = new[]
			{
				new AssignableDTO {ID = 2, Name = "Second general", EntityTypeID = QueryEntityTypeProvider.USERSTORY_TYPE_ID, ProjectID = 1, SquadID = 1, },
				new AssignableDTO {ID = 3, Name = "Third general", EntityTypeID = QueryEntityTypeProvider.BUG_TYPE_ID, ProjectID = 1, SquadID = 1},
			};
			var generals = _assignables.Select(a => new GeneralDTO {ID = a.ID, Name = a.Name, EntityTypeID = a.EntityTypeID, ParentProjectID = a.ProjectID}).ToArray();

			_comments = new[]
			{
				new CommentDTO {GeneralID = 2, CommentID = 1, Description = "FirstDescription"},
			};

			_assignableSquads = new[]
			{
				new AssignableSquadDTO { AssignableSquadID = 1, AssignableID = 2, SquadID = 1}
			};

			_transport.On<GeneralQuery>().Reply(x => ReplyOnEntityQuery<GeneralQuery, GeneralDTO, GeneralQueryResult>(x, generals));
			_transport.On<AssignableQuery>().Reply(x => ReplyOnEntityQuery<AssignableQuery, AssignableDTO, AssignableQueryResult>(x, _assignables));
			_transport.On<ImpedimentQuery>().Reply(x => new ImpedimentQueryResult { Dtos = new ImpedimentDTO[] { }, QueryResultCount = 0, TotalQueryResultCount = 0, FailedDtosCount = 0 });
			_transport.On<ReleaseProjectQuery>().Reply(x => new ReleaseProjectQueryResult { Dtos = new ReleaseProjectDTO[] { }, QueryResultCount = 0, TotalQueryResultCount = 0, FailedDtosCount = 0 });
			_transport.On<RetrieveAllAssignableSquadsQuery>().Reply(x => ReplyOnEntityQuery<RetrieveAllAssignableSquadsQuery, AssignableSquadDTO, AssignableSquadQueryResult>(x, _assignableSquads));
			_transport.On<CommentQuery>().Reply(x => ReplyOnEntityQuery<CommentQuery, CommentDTO, CommentQueryResult>(x, _comments));
			_transport.On<TestStepQuery>().Reply(x => ReplyOnEntityQuery<TestStepQuery, TestStepDTO, TestStepQueryResult>(x, new TestStepDTO[0]));
		}
		public void Setup()
		{
			_accountCollection = new AccountCollectionMock();
			_bus = new TpBusMock();
			_pluginContextMock = new PluginContextMock();
			_msmqTransport = ObjectFactory.GetInstance<TransportMock>();
			_accountHandler = new AccountHandler(_accountCollection, _bus, _pluginContextMock,
			                                     new TpLogManager(new ActivityLogPathProvider(), _pluginContextMock),
												 _msmqTransport);
		}
		public VcsPluginContext(TransportMock transportMock)
		{
			_transport = transportMock;

			_contextExpectations = new ContextExpectations(this);
			TpUsers = new List<TpUserMappingInfo>();

			Transport.On<RetrieveAllUsersQuery>()
				.Reply(x => CreateRetrieveAllUsersQueryReply());

			On.CreateCommand<RevisionDTO>().Reply(CreateRevisionCreatedMessage);
			On.CreateCommand<RevisionFileDTO>().Reply(CreateRevisionFileCreatedMessage);
			On.CreateCommand<RevisionAssignableDTO>().Reply(CreateRevisionAssignableCreatedMessage);
		}
		public void BeforeScenario()
		{
			_transportMock = TransportMock.CreateWithoutStructureMapClear(typeof (WhenAddANewProfileSpecs).Assembly,
			                                                              typeof (WhenAddANewProfileSpecs).Assembly);

			var commands = ObjectFactory.GetInstance<IPluginCommandRepository>();

			ObjectFactory.EjectAllInstancesOf<IPluginCommandRepository>();
			ObjectFactory.Configure(x =>
			                        	{
			                        		x.For<IPluginCommandRepository>().Singleton().Use<PluginCommandMockRepository>();
			                        		x.Forward<IPluginCommandRepository, PluginCommandMockRepository>();
			                        	});

			var pluginCommandMockRepository = ObjectFactory.GetInstance<PluginCommandMockRepository>();
			foreach (var command in commands)
			{
				pluginCommandMockRepository.Add(command);
			}
		}
		public void Init()
		{
			_transport = TransportMock.CreateWithoutStructureMapClear(typeof (CreateTasksForNewUserStoryHandler).Assembly);

			const int projectId = 123;
			const int userStoryId = 123;
			_profileInstance = _transport.AddProfile("Profile1",
			                                         new TaskCreatorProfile
			                                         	{Project = projectId, TasksList = "Task", CommandName = "{CT}"});

			_userStoryCreatedMessage = new UserStoryCreatedMessage
			                           	{
			                           		Dto =
			                           			new UserStoryDTO
			                           				{
			                           					ProjectID = projectId,
			                           					UserStoryID = userStoryId,
			                           					Name = "{CT}User Story Name"
			                           				}
			                           	};
		}
        public void Init()
        {
            ObjectFactory.Initialize(x => x.AddRegistry <TfsRegistry>());
            ObjectFactory.Configure(
                x =>
                x.For <TransportMock>().Use(TransportMock.CreateWithoutStructureMapClear(
                                                typeof(TfsPluginProfile).Assembly,
                                                new List <Assembly> {
                typeof(Command).Assembly
            })));

            _testRepository = new TfsTestRepository();
            _tfsRepoUri     = _testRepository.Uri.ToString();

            _profile = ObjectFactory.GetInstance <TransportMock>().AddProfile(
                "Profile",
                new TfsPluginProfile
            {
                Uri           = _tfsRepoUri,
                Login         = _testRepository.Login,
                Password      = _testRepository.Password,
                StartRevision = "1"
            });
        }
Пример #10
0
 public void Init()
 {
     //This configures structureMap inside.
     TransportMock.CreateWithoutStructureMapClear(typeof(WhenAddANewProfileSpecs).Assembly,
                                                  typeof(WhenAddANewProfileSpecs).Assembly);
 }
 public void BeforeScenario()
 {
     _transportMock = TransportMock.CreateWithoutStructureMapClear(typeof(ProjectEmailProfile).Assembly,
                                                                   typeof(ProjectEmailProfile).Assembly);
 }
		public CreateCommandExpectations(Type dtoType, TransportMock transport)
		{
			_dtoType = dtoType;
			_transport = transport;
		}
 public void AddProfile(string profileName)
 {
     TransportMock.AddProfile(profileName, GetTfsPluginProfile());
 }
 public void Setup()
 {
     TransportMock.CreateWithoutStructureMapClear(typeof(ProjectEmailProfile).Assembly);
 }
 public void SetUp()
 {
     ObjectFactory.Initialize(x => x.AddRegistry <VcsEnvironmentRegistry>());
     ObjectFactory.Configure(x => x.For <TransportMock>().Use(TransportMock.CreateWithoutStructureMapClear(typeof(SubversionPluginProfile).Assembly)));
 }
		public void BeforeScenario()
		{
			_transportMock = TransportMock.CreateWithoutStructureMapClear(typeof (WhenAddANewProfileSpecs).Assembly,
			                                                              typeof (WhenAddANewProfileSpecs).Assembly);
		}
 public CreateCommandExpectations(Type dtoType, TransportMock transport)
 {
     _dtoType   = dtoType;
     _transport = transport;
 }
 public TestRunImportPluginContext(TransportMock transportMock)
 {
     Transport = transportMock;
 }
 public void Setup()
 {
     ObjectFactory.Configure(x => x.For <TransportMock>().HybridHttpOrThreadLocalScoped().Use(TransportMock.CreateWithoutStructureMapClear(typeof(BugzillaProfile).Assembly)));
 }
Пример #20
0
 public void AddProfileWithDefaultRolesMapping(string profileName, int projectId)
 {
     TransportMock.AddProfile(profileName, GetBugzillaProfileWithDefaultRolesMapping(projectId));
 }
        protected override void OnSetup()
        {
            base.OnSetup();
            _transport = TransportMock.CreateWithoutStructureMapClear(typeof(SearcherProfile).Assembly, new[] { typeof(SearcherProfile).Assembly }, new Assembly[] { });
            _generals  = new[]
            {
                new GeneralDTO {
                    ID = 1, Name = "First general assignable", EntityTypeID = QueryEntityTypeProvider.USERSTORY_TYPE_ID, ParentProjectID = 1
                },
                new GeneralDTO {
                    ID = 2, Name = "Second general assignable", EntityTypeID = QueryEntityTypeProvider.USERSTORY_TYPE_ID, ParentProjectID = 1
                },
                new GeneralDTO {
                    ID = 3, Name = "Third general assignable", EntityTypeID = QueryEntityTypeProvider.BUG_TYPE_ID, ParentProjectID = 1
                },
                new GeneralDTO {
                    ID = 4, Name = "Fourth general", EntityTypeID = QueryEntityTypeProvider.TESTCASE_TYPE_ID, ParentProjectID = 1
                }
            };

            _comments = new[]
            {
                new CommentDTO {
                    GeneralID = 1, CommentID = 1, Description = "FirstDescription"
                },
                new CommentDTO {
                    GeneralID = 2, CommentID = 2, Description = "SecondDescription"
                }
            };

            _assignables = new[]
            {
                new AssignableDTO {
                    ID = 2, EntityStateID = 11, SquadID = 10, ProjectID = 1, EntityTypeID = QueryEntityTypeProvider.USERSTORY_TYPE_ID
                },
                new AssignableDTO {
                    ID = 3, EntityStateID = 12, SquadID = 11, ProjectID = 1, EntityTypeID = QueryEntityTypeProvider.BUG_TYPE_ID
                }
            };

            _testSteps = new[]
            {
                new TestStepDTO {
                    ID = 1, TestCaseID = 4, Description = "First Test Step Description"
                },
                new TestStepDTO {
                    ID = 2, TestCaseID = 4, Result = "Second Test Step Result"
                }
            };

            _transport.On <GeneralQuery>().Reply(x => ReplyOnEntityQuery <GeneralQuery, GeneralDTO, GeneralQueryResult>(x, _generals));
            _transport.On <CommentQuery>().Reply(x => ReplyOnEntityQuery <CommentQuery, CommentDTO, CommentQueryResult>(x, _comments));
            _transport.On <ImpedimentQuery>().Reply(x => new ImpedimentQueryResult {
                Dtos = new ImpedimentDTO[] { }, QueryResultCount = 0, TotalQueryResultCount = 0, FailedDtosCount = 0
            });
            _transport.On <ReleaseProjectQuery>().Reply(x => new ReleaseProjectQueryResult {
                Dtos = new ReleaseProjectDTO[] { }, QueryResultCount = 0, TotalQueryResultCount = 0, FailedDtosCount = 0
            });
            _transport.On <AssignableQuery>().Reply(x => ReplyOnAssignableQuery(x, _assignables));
            _transport.On <TestStepQuery>().Reply(x => ReplyOnEntityQuery <TestStepQuery, TestStepDTO, TestStepQueryResult>(x, _testSteps));
        }
 public void CreateProfileForAccount(string profileName, string accountName)
 {
     TransportMock.AddProfile(profileName, accountName, new MashupManagerProfile());
 }
 public void CreateProfile(string profileName)
 {
     TransportMock.AddProfile(profileName, new MashupManagerProfile());
 }
 public void BeforeScenario()
 {
     _transportMock = TransportMock.CreateWithoutStructureMapClear(typeof (ProjectEmailProfile).Assembly,
                                                                   typeof (ProjectEmailProfile).Assembly);
 }
		public TestRunImportPluginContext(TransportMock transportMock)
		{
			Transport = transportMock;
		}
Пример #26
0
 public void BeforeScenario()
 {
     _transportMock = TransportMock.CreateWithoutStructureMapClear(typeof(WhenAddANewProfileSpecs).Assembly,
                                                                   typeof(WhenAddANewProfileSpecs).Assembly);
 }
Пример #27
0
 public void AddProfileWithDefaultRolesMapping(string profileName, int projectId, BugzillaProfile profile)
 {
     SetDefaultRolesMapping(profile);
     TransportMock.AddProfile(profileName, profile);
 }
 public void CreateBugInitializationSaga()
 {
     _transport = TransportMock.CreateWithoutStructureMapClear(typeof(BugInitializationSaga).Assembly,
                                                               Assembly.GetExecutingAssembly());
 }
Пример #29
0
 public void AddProfile(string profileName, int projectId)
 {
     TransportMock.AddProfile(profileName, GetBugzillaProfile(projectId));
 }
 public void Init()
 {
     _handled   = false;
     _transport = TransportMock.CreateWithoutStructureMapClear(typeof(ReplyMessage).Assembly, Assembly.GetExecutingAssembly());
     _transport.AddProfile("Profile_1");
 }