Ejemplo n.º 1
0
        public IMenu GetMenu(PageViewModel pageViewModel)
        {
            ProfilingViewModel profilingViewModel = pageViewModel as ProfilingViewModel;

            if (profilingViewModel != null)
            {
                IProfilingApplication  application  = profilingViewModel.Application;
                ResolutionDependencies dependencies = new ResolutionDependencies();
                dependencies.Register(application);
                dependencies.Register(profilingViewModel);
                return(MenuReader.ReadMenu(Resources.Menu, dependencies));
            }
            return(null);
        }
Ejemplo n.º 2
0
 public ThreadsMenuItem(ProfilingViewModel profilingViewModel)
     : base(profilingViewModel)
 {
 }
Ejemplo n.º 3
0
 public AppDomainsMenuItem(ProfilingViewModel profilingViewModel)
     : base(profilingViewModel)
 {
 }
Ejemplo n.º 4
0
 public ManagedExceptionsMenuItem(ProfilingViewModel profilingViewModel)
     : base(profilingViewModel)
 {
 }
Ejemplo n.º 5
0
        //private EventsTreeViewModel _viewModel;

        public PerformanceMenuItem(ProfilingViewModel profilingViewModel)
        {
            _profilingViewModel = profilingViewModel;
        }
 public ThreadsTreeMenuItem(ProfilingViewModel profilingViewModel)
 {
     _profilingViewModel = profilingViewModel;
 }
Ejemplo n.º 7
0
 public TimelineMenuItem(ProfilingViewModel profilingViewModel)
 {
     _profilingViewModel = profilingViewModel;
 }
Ejemplo n.º 8
0
 public FunctionsMenuItem(ProfilingViewModel profilingViewModel)
     : base(profilingViewModel)
 {
 }
 public AssembliesMenuItem(ProfilingViewModel profilingViewModel)
     : base(profilingViewModel)
 {
 }
        public async Task GetAllReleasedProfileTotals_Returns_Mapped_Profiling_Result_Given_PublishingApi_Returns_Valid_ProfileTotals_Response()
        {
            ProfileTotal aProfileTotalOneYearInThePast = new ProfileTotal
            {
                Occurrence = 1,
                TypeValue  = "October",
                Year       = DateTime.Now.AddYears(-1).Year,
                Value      = 111.0m
            };
            ProfileTotal aProfileTotalOneMonthInThePast = new ProfileTotal
            {
                Occurrence = 2,
                TypeValue  = DateTime.Now.AddMonths(-1).ToString("MMMM"),
                Year       = DateTime.Now.AddMonths(-1).Year,
                Value      = 112.0m
            };
            ProfileTotal aProfileTotalOneYearInTheFuture = new ProfileTotal
            {
                Occurrence = 3,
                TypeValue  = "April",
                Year       = DateTime.Now.AddYears(1).Year,
                Value      = 113.0m
            };
            List <ProfileTotal> profileTotals = new List <ProfileTotal>
            {
                aProfileTotalOneYearInThePast,
                aProfileTotalOneMonthInThePast,
                aProfileTotalOneYearInTheFuture
            };
            ProfilingVersion latestProfilingVersion = new ProfilingVersion
            {
                Date          = new DateTimeOffset(),
                ProfileTotals = profileTotals,
                Version       = 2
            };
            ProfilingVersion previousProfilingVersion = new ProfilingVersion
            {
                Date          = new DateTimeOffset(),
                ProfileTotals = new List <ProfileTotal>
                {
                    new ProfileTotal
                    {
                        Occurrence = 1,
                        TypeValue  = DateTime.Now.ToString("MMMM"),
                        Year       = DateTime.Now.Year,
                        Value      = 999.0m
                    },
                    new ProfileTotal
                    {
                        Occurrence = 2,
                        TypeValue  = DateTime.Now.ToString("MMMM"),
                        Year       = DateTime.Now.Year,
                        Value      = 1.0m
                    }
                },
                Version = 1
            };
            IDictionary <int, ProfilingVersion> profileVersions =
                new Dictionary <int, ProfilingVersion>
            {
                {
                    latestProfilingVersion.Version, latestProfilingVersion
                },
                {
                    previousProfilingVersion.Version, previousProfilingVersion
                }
            };

            ApiResponse <IDictionary <int, ProfilingVersion> > publishingApiResponse =
                new ApiResponse <IDictionary <int, ProfilingVersion> >(HttpStatusCode.OK, profileVersions);

            _publishingApiClient.GetAllReleasedProfileTotals(
                Arg.Any <string>(),
                Arg.Any <string>(),
                Arg.Any <string>())
            .Returns(publishingApiResponse);

            IActionResult result = await _publishController.GetAllReleasedProfileTotals(
                "A VALID FUNDING STREAM ID",
                "A VALID FUNDING PERIOD ID",
                "A VALID PROVIDER ID");

            ProfilingViewModel profilingViewModelResult = result.As <OkObjectResult>().Value.As <ProfilingViewModel>();

            result.Should().BeAssignableTo <OkObjectResult>();
            profilingViewModelResult.TotalAllocation.Should().Be(latestProfilingVersion.ProfileTotals.Sum(
                                                                     profileTotal => profileTotal.Value));
            profilingViewModelResult.PreviousAllocation.Should().Be(previousProfilingVersion.ProfileTotals.Sum(
                                                                        profileTotal => profileTotal.Value));

            List <ProfilingInstallment> profilingInstallments = profilingViewModelResult.ProfilingInstallments.ToList();

            profilingInstallments[0].InstallmentMonth.Should()
            .Be(aProfileTotalOneYearInThePast.TypeValue);
            profilingInstallments[0].InstallmentYear.Should()
            .Be(aProfileTotalOneYearInThePast.Year);
            profilingInstallments[0].InstallmentNumber.Should()
            .Be(aProfileTotalOneYearInThePast.Occurrence);
            profilingInstallments[0].InstallmentValue.Should()
            .Be(aProfileTotalOneYearInThePast.Value);
            profilingInstallments[0].IsPaid.Should()
            .Be(true);
            profilingInstallments[1].IsPaid.Should()
            .Be(true);
            profilingInstallments[2].IsPaid.Should()
            .Be(false);
        }
Ejemplo n.º 11
0
 public ClassesMenuItem(ProfilingViewModel profilingViewModel)
     : base(profilingViewModel)
 {
 }
Ejemplo n.º 12
0
 public EventsTreeMenuItem(ProfilingViewModel profilingViewModel)
 {
     _profilingViewModel = profilingViewModel;
 }
Ejemplo n.º 13
0
 protected UnitsMenuItemBase(ProfilingViewModel profilingViewModel)
 {
     ProfilingViewModel = profilingViewModel;
 }
Ejemplo n.º 14
0
 public ModulesMenuItem(ProfilingViewModel profilingViewModel)
     : base(profilingViewModel)
 {
 }