public void SetAxis_DimensionNonExistant() { var ac = WhenIHaveA <AggregateConfiguration>(); var cmd = new ExecuteCommandSetAxis(GetMockActivator().Object, ac, "fff"); var ex = Assert.Throws <Exception>(() => cmd.Execute()); Assert.AreEqual("Could not find AggregateDimension fff in Aggregate My graph so could not set it as an axis dimension. Try adding the column to the aggregate first", ex.Message); }
public void SetAxis_ExistsButIsNotADate() { var ac = WhenIHaveA <AggregateConfiguration>(); var dim = WhenIHaveA <AggregateDimension>(); dim.AggregateConfiguration_ID = ac.ID; dim.Alias = "frogmarch"; var cmd = new ExecuteCommandSetAxis(GetMockActivator().Object, ac, "frogmarch"); var ex = Assert.Throws <Exception>(() => cmd.Execute()); Assert.AreEqual("AggregateDimension frogmarch is not a Date so cannot set it as an axis for Aggregate My graph", ex.Message); }
public void SetAxis_Exists() { var ac = WhenIHaveA <AggregateConfiguration>(); var dim = WhenIHaveA <AggregateDimension>(); dim.AggregateConfiguration_ID = ac.ID; dim.Alias = "frogmarch"; dim.ColumnInfo.Data_type = "datetime"; Assert.IsNull(ac.GetAxisIfAny()); var cmd = new ExecuteCommandSetAxis(GetMockActivator().Object, ac, "frogmarch"); cmd.Execute(); Assert.IsNotNull(ac.GetAxisIfAny()); cmd = new ExecuteCommandSetAxis(GetMockActivator().Object, ac, null); cmd.Execute(); Assert.IsNull(ac.GetAxisIfAny()); }