示例#1
0
 public void AddTrainee(ITrainee trainee)
 {
     if (!Trainees.Contains(trainee))
     {
         Trainees.Add(trainee);
     }
 }
示例#2
0
        public static TraineeContext ConvertToTraineeContext(this ITrainee trainee)
        {
            TraineeContext context = new TraineeContext();

            context.Id                = trainee.Id.ToString();
            context.UserName          = trainee.UserName;
            context.UserType          = trainee.UserType;
            context.Created           = trainee.Created;
            context.IsActive          = trainee.IsActive;
            context.Email             = trainee.Email;
            context.Description       = trainee.Description;
            context.Location          = trainee.Location.ConvertToLocationContext();
            context.Modified          = trainee.Modified;
            context.Password          = trainee.Password;
            context.PhoneNumber       = trainee.PhoneNumber;
            context.PhoneVisibility   = trainee.PhoneVisibility;
            context.UserVisibility    = trainee.UserVisibility;
            context.Birthday          = trainee.Birthday;
            context.Gender            = trainee.Gender;
            context.Achievements      = trainee.Challenges.ConvertToChallengesContexts();
            context.MedicalCondition  = trainee.MedicalCondition.ToMedicalConditionContext();
            context.Name              = trainee.Name;
            context.FavouriteExercise = trainee.FavouriteExercise.ConvertToExerciseContext();

            return(context);
        }
        public AsyncFloodFillLabelerUnsafe(ITrainee learned, Bitmap image, int rarity, object userState)
            : base(learned, image)
        {
            this.rarity = rarity;

            AsyncOperation operation = AsyncOperationManager.CreateOperation(userState);
            userStates.Add(userState, operation);
        }
        public ImageScanner(ITrainee learned, Bitmap image)
        {
            if (image.Width * image.Height > 700 * 700)
            {
                int rate = 300;
                float coef = (float)image.Height / (float)rate;
                Image = new Bitmap(image, new Size((int)((float)image.Width / coef), rate));
            }
            else
            {
                Image = new Bitmap(image);
            }

            this.learned = learned;
            this.Image = image;
        }
示例#5
0
        void CreateTraineeMock()
        {
            traineeMock = Substitute.For(
                new[] { typeof(ITrainee), typeof(Trainee) },
                new object[0]
                ) as ITrainee;
            traineeMock.Id.Returns(1);
            traineeMock.CreationDate.Returns(DateTime.Now);
            traineeMock.Name.Returns("TestName");
            traineeMock.LastName.Returns("TestLastName");
            traineeMock.Patronymic.Returns("TestPatronymic");
            traineeMock.DrivingLicense.Returns("TestPassportSeria");
            traineeMock.AddressRegistration.Returns("TestPassportSeria");
            traineeMock.AddressCurrent.Returns("TestPassportSeria");
            traineeMock.INN.Returns("TestPassportSeria");

            var phones = new List <Vodovoz.Domain.Contacts.Phone>();

            //TODO возможно здесь нужно сделать мок для Phone
            phones.Add(new Vodovoz.Domain.Contacts.Phone {
                Name = "TestPhoneName"
            });
            traineeMock.Phones.Returns(phones);

            var documents = new List <EmployeeDocument>();

            documents.Add(new EmployeeDocument {
                Id = 5, Name = "TestDoc"
            });
            traineeMock.Documents.Returns(documents);

            //TODO возможно здесь нужно сделать мок для Nationality
            traineeMock.Nationality.Returns(new Nationality {
                Name = "TestNationality"
            });
            traineeMock.Citizenship.Returns(new Citizenship {
                Name = "TestCitizenship"
            });
            traineeMock.Photo.Returns(new byte[] { 1, 2, 3 });
        }
 public FloodFillLabelerUnsafe(ITrainee learned, Bitmap image, int rarity)
     : base(learned, image)
 {
     this.rarity = rarity;
 }
 public void SetTrainee(TraineeBase learned)
 {
     this.learned = learned;
 }
 public ImageScanner(ITrainee learned, string file)
     : this(learned, new Bitmap(file))
 {
     ;
 }
 public ImageScanner(ITrainee learned)
     : this(learned, string.Empty)
 {
     ;
 }
示例#10
0
 public void Save(ITrainee trainee)
 {
 }
示例#11
0
 public void SetStrategy(ITrainee strategy)
 {
     this.strategy = strategy;
 }
示例#12
0
 public Trainer(ITrainee defaultStrategy)
 {
     this.strategy = defaultStrategy;
 }
 public FloodFillLabeler(ITrainee trainee, Bitmap image)
     : base(trainee, image)
 {
     ;
 }