Esempio n. 1
0
            public void ResultToFeatureListVm_Should_Throw_Exception_When_Results_Is_Null()
            {
                GetFeaturesQueryResult results = null;

                IConfiguration config = GetConfig();

                FeatureListVm actual = FeatureModelHelper.ResultToFeatureListVm(results, config);
            }
Esempio n. 2
0
            public void ResultToFeatureListVm_Should_Throw_Exception_When_Config_Is_Null()
            {
                ICollection <Feature>  features = new List <Feature>();
                GetFeaturesQueryResult results  = new GetFeaturesQueryResult(features);

                IConfiguration config = null;

                FeatureListVm actual = FeatureModelHelper.ResultToFeatureListVm(results, config);
            }
Esempio n. 3
0
            public void ResultToFeatureListVm_Should_Return_FeatureListVm_When_No_Items_Found()
            {
                ICollection <Feature>  features = new List <Feature>();
                GetFeaturesQueryResult results  = new GetFeaturesQueryResult(features);

                IConfiguration config = GetConfig();

                FeatureListVm actual = FeatureModelHelper.ResultToFeatureListVm(results, config);

                Assert.AreEqual(MessagesModel.NoItemsFound, actual.Message);
                Assert.AreEqual(MessagesModel.MessageStyles.Info, actual.MessageStyle);
            }
Esempio n. 4
0
            public void ResultToFeatureListVm_Should_Return_FeatureListVm_When_Items_Found()
            {
                DateTime date = DateTime.Now;
                ICollection <Feature> features = new List <Feature>();
                Feature feature = new Feature("1", date, "Feature1", "testuser");

                features.Add(feature);
                feature = new Feature("2", date, "Feature2", "testuser");
                features.Add(feature);
                feature = new Feature("3", date, "Feature3", "testuser");
                features.Add(feature);
                GetFeaturesQueryResult results = new GetFeaturesQueryResult(features);

                IConfiguration config = GetConfig();

                FeatureListVm actual = FeatureModelHelper.ResultToFeatureListVm(results, config);

                Assert.AreEqual(3, actual.Features.Count);
            }