public override void Export(IDocumentComponent docs, string destDirFullPath)
        {
            this.exporter.Export(docs, destDirFullPath);

            var encryptingService = new EncryptingService();

            encryptingService.Encrypt(destDirFullPath);
        }
        public void DecodeId_WithNullId_ThrowsArgumentNullException()
        {
            IEncryptingService provider = new EncryptingService();

            Assert.That(() => provider.DecodeId(null),
                        Throws.TypeOf <ArgumentNullException>()
                        .With.Message.Contain("The argument is null."));
        }
        public void DecodeId_WithValidId_ReturnDecodedId()
        {
            var id = "MWFua1NhbGx0";
            IEncryptingService provider = new EncryptingService();

            var decodedId = provider.DecodeId(id);

            Assert.AreEqual(1, decodedId);
        }
        public void EncodeId_WithValidId_ReturnDecodedId()
        {
            var id = 1;
            IEncryptingService provider = new EncryptingService();

            var encodedId = provider.EncodeId(id);

            Assert.AreEqual("MWFua1NhbGx0", encodedId);
        }
Exemplo n.º 5
0
        public void CreateMappings(IMapperConfigurationExpression configuration)
        {
            IEncryptingService encryptingService = new EncryptingService();

            configuration.CreateMap <ClassEntity, ClassDomain>()
            .ForMember(domain => domain.Id, x => x.MapFrom(entity => encryptingService.EncodeId(entity.Id)));

            configuration.CreateMap <ClassDomain, ClassEntity>()
            .ForMember(entity => entity.Id, x => x.MapFrom(domain => encryptingService.DecodeId(domain.Id)));
        }