Esempio n. 1
0
        public void AddRelevantError()
        {
            var axisSet = new AxisSet(new Axis []
            {
                new Axis("Axis 1", typeof(string), true),
                new Axis("Expiry Date", typeof(DateTime), true)
            });

            var cube = new Cube.Cube <CubeValueDouble>(axisSet);

            var errorKeys = new Dictionary <string, object>();

            errorKeys ["Axis 1"] = "Bob";
            cube.AddError(errorKeys, "Error");
        }
Esempio n. 2
0
        public void AddErrorWithWrongDataType()
        {
            var axisSet = new AxisSet(new Axis []
            {
                new Axis("Axis 1", typeof(string), true),
                new Axis("Expiry Date", typeof(DateTime), true)
            });

            var cube = new Cube.Cube <CubeValueDouble>(axisSet);

            var errorKeys = new Dictionary <string, object>();

            errorKeys ["Axis 1 "] = DateTime.Today;

            try
            {
                cube.AddError(errorKeys, "Error");
                Assert.Fail("Shouldn't be able to add error");
            }
            catch
            {
            }
        }