예제 #1
0
        public static void ConfigureFaceMatch(this IServiceCollection services, IConfiguration config)
        {
            FaceMatchSettings settings =
                config.GetSection(FaceMatchSettings).Get <FaceMatchSettings>();

            services.AddSingleton <FaceMatchSettings>(settings);
        }
예제 #2
0
 public IndexModel(
     FaceMatchSettings faceMatchSettings,
     IFaceMatcher faceMatcher,
     ICannedExample cannedExample,
     ILogger <IndexModel> logger)
 {
     this.FaceMatchSettings = faceMatchSettings;
     this.faceMatcher       = faceMatcher;
     this.cannedExample     = cannedExample;
     this.logger            = logger;
 }
예제 #3
0
        public IndexModelTests()
        {
            this.mockRepository = new MockRepository(MockBehavior.Strict);

            this.fakeFaceMatchSettings = new FaceMatchSettings
            {
                MaxNumberOfFaces      = 10,
                MaxImageSizeInBytes   = 1234,
                SupportedCountryCodes = new List <string> {
                    "ro", "ru"
                }
            };

            this.mockFaceMatcher   = this.mockRepository.Create <IFaceMatcher>();
            this.mockCannedExample = this.mockRepository.Create <ICannedExample>();
            this.mockUserImage     = this.mockRepository.Create <IFormFile>();

            this.mockLogger = this.mockRepository.Create <ILogger <IndexModel> >(MockBehavior.Loose);
        }
예제 #4
0
        public FaceMatcherTests()
        {
            this.mockRepository = new MockRepository(MockBehavior.Strict);

            this.mockFaceIdLookup = this.mockRepository.Create <IFaceIdToNameLookup>();

            this.mockFaceOperations = this.mockRepository.Create <IFaceOperations>();
            this.mockFaceClient     = this.mockRepository.Create <IFaceClient>();
            this.mockFaceClient.Setup(mock => mock.Face).Returns(this.mockFaceOperations.Object);
            this.mockFaceClient.Setup(mock => mock.Dispose());

            this.faceMatchSettings =
                new FaceMatchSettings()
            {
                FaceListNameFormat = "faces-{countrycode}-{gender}"
            };

            this.mockLogger = this.mockRepository.Create <ILogger <FaceMatcher> >(MockBehavior.Loose);
        }