Пример #1
0
 public void Setup() {
     secrets = Secrets.LoadFromFile("aws.secrets");
     var config = new SimolConfig {
         AutoCreateDomains = true,
         Cache = null,
         ReadConsistency = ConsistencyBehavior.Immediate
     };
     simolClient = new SimolClient(secrets.AwsAccessKeyId, secrets.AwsSecretAccessKey, config);
 }
Пример #2
0
        public MailStore(Secrets secrets) {
            ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;

            var config = new SimolConfig {
                AutoCreateDomains = true,
                Cache = null,
                ReadConsistency = ConsistencyBehavior.Immediate
            };
            simolClient = new SimolClient(secrets.Username, secrets.Password, config);
        }
Пример #3
0
        public void Stale_Data_is_detected() {
            var person1 = new StaleSafePerson {
                Name = "Stefan"
            };

            simolClient.Put(person1);

            var simolClient2 = new SimolClient(secrets.AwsAccessKeyId, secrets.AwsSecretAccessKey);
            var person2 = simolClient2.Get<StaleSafePerson>(person1.Id);

            Assert.That(person1, Is.Not.SameAs(person2));
            Assert.That(person2.Id, Is.EqualTo(person1.Id));
            Assert.That(person2.Name, Is.EqualTo(person1.Name));

            person1.Name = "Paul";
            simolClient.Put(person1);

            person2.Name = "Jakob";
            simolClient2.Put(person2);   // Throws
        }
Пример #4
0
 public void Setup() {
     secrets = Secrets.LoadFromFile("aws.secrets");
     simolClient = new SimolClient(secrets.AwsAccessKeyId, secrets.AwsSecretAccessKey);
 }