예제 #1
0
        public void DoesNotCrash()
        {
            var impressionHasher = new ImpressionHasher();

            var impression = new KeyImpression
            {
                feature      = null,
                keyName      = "someKeyName",
                treatment    = "someTreatment",
                changeNumber = 3245463,
                label        = "someLabel"
            };

            Assert.IsNotNull(impressionHasher.Process(impression));

            impression.keyName = null;
            Assert.IsNotNull(impressionHasher.Process(impression));

            impression.changeNumber = null;
            Assert.IsNotNull(impressionHasher.Process(impression));

            impression.label = null;
            Assert.IsNotNull(impressionHasher.Process(impression));

            impression.treatment = null;
            Assert.IsNotNull(impressionHasher.Process(impression));
        }
예제 #2
0
        public void Works()
        {
            var impressionHasher = new ImpressionHasher();

            var impression = new KeyImpression
            {
                feature      = "someFeature",
                keyName      = "someKeyName",
                treatment    = "someTreatment",
                changeNumber = 3245463,
                label        = "someLabel"
            };

            var impression2 = new KeyImpression
            {
                feature      = "someFeature",
                keyName      = "someKeyName",
                treatment    = "otherTreatment",
                changeNumber = 3245463,
                label        = "someLabel"
            };

            var result  = impressionHasher.Process(impression);
            var result2 = impressionHasher.Process(impression2);

            Assert.AreNotEqual(result, result2);

            impression2.keyName = "otherKeyName";
            var result3 = impressionHasher.Process(impression2);

            Assert.AreNotEqual(result2, result3);

            impression2.feature = "otherFeature";
            var result4 = impressionHasher.Process(impression2);

            Assert.AreNotEqual(result3, result4);

            impression2.treatment = "treatment";
            var result5 = impressionHasher.Process(impression2);

            Assert.AreNotEqual(result4, result5);

            impression2.label = "otherLabel";
            var result6 = impressionHasher.Process(impression2);

            Assert.AreNotEqual(result5, result6);

            impression2.changeNumber = 888755;
            var result7 = impressionHasher.Process(impression2);

            Assert.AreNotEqual(result6, result7);
        }