Beispiel #1
0
 public TestContext(ILogTracer logTracer, IStorage storage, ICreds creds, string storagePrefix)
 {
     EntityConverter      = new EntityConverter();
     ServiceConfiguration = new TestServiceConfiguration(storagePrefix);
     Storage               = storage;
     Creds                 = creds;
     Containers            = new Containers(logTracer, Storage, Creds, ServiceConfiguration);
     Queue                 = new Queue(Storage, logTracer);
     RequestHandling       = new RequestHandling(logTracer);
     TaskOperations        = new TaskOperations(logTracer, this);
     NodeOperations        = new NodeOperations(logTracer, this);
     JobOperations         = new JobOperations(logTracer, this);
     NodeTasksOperations   = new NodeTasksOperations(logTracer, this);
     TaskEventOperations   = new TaskEventOperations(logTracer, this);
     NodeMessageOperations = new NodeMessageOperations(logTracer, this);
     ConfigOperations      = new ConfigOperations(logTracer, this);
     PoolOperations        = new PoolOperations(logTracer, this);
     ScalesetOperations    = new ScalesetOperations(logTracer, this);
     UserCredentials       = new UserCredentials(logTracer, ConfigOperations);
 }
Beispiel #2
0
        public void ShouldGetTeamByName()
        {
            var bindings = new TestServiceConfiguration();

            //data to return
            var team1 = new Team()
            {
                Name = "Team 1", Active = false, FirstYear = 15
            };

            //mock the methods we'll use
            var teamRepository = new Mock <ITeamRepository>();

            teamRepository.Setup(x => x.GetByName("Team 1")).Returns(team1);

            //make the service call
            var service = new TeamService(teamRepository.Object, bindings.Mapper);

            var model = service.GetByName("Team 1");

            Equal(team1.Name, model.Name);
        }