public void ShouldReturnEmptyListWhenEverythingIsFine()
        {
            Config.Environment = Config.Test;

            List<string> actual = new SanityChecker(new SalsaClient()).VerifyQueues();
            Console.WriteLine(string.Join(",", actual));
            Assert.IsEmpty(actual);
        }
Exemplo n.º 2
0
 public void SanityCheck()
 {
     Logger.Info("Verifying SyncConfig / FieldMappings...");
     var sanityChecker = new SanityChecker(_salsaClient);
     var errors = sanityChecker.VerifyQueues();
     errors.AddRange(sanityChecker.VerifySalsaFields());
     if(errors.Count > 0)
         throw new ApplicationException("SyncConfig / FieldMapping verification failed. " + string.Join(", ", errors));
     Logger.Info("SyncConfig / FieldMappings match queues and salsalabs.com");
 }
        public void SetUp()
        {
            Config.Environment = Config.Test;
            _salsaClient = new Mock<ISalsaClient>();
            TestUtils.RemoveSyncConfigForObjectType(ObjectType);
            TestUtils.CreateSyncConfig(ObjectType, SyncDirection.Export, 1);
            TestUtils.CreateSyncConfig(ObjectType, SyncDirection.Import, 2);

            TestUtils.RemoveFieldMappingsForObjectType(ObjectType);
            var mapping1 = new FieldMapping { AftField = "f1", DataType = DataType.String, ObjectType = ObjectType, MappingRule = "aftWins", SalsaField = "f1" };
            var mapping2 = new FieldMapping { AftField = "First_Name", DataType = DataType.Int, ObjectType = ObjectType, MappingRule = "aftWins", SalsaField = "First_Name" };
            TestUtils.CreateFieldMappings(mapping1);
            TestUtils.CreateFieldMappings(mapping2);
            _sanityChecker = new SanityChecker(_salsaClient.Object);
        }