angular .module('abc') .factory('dashboard', dashboard); function dashboard($http, notifier) { var service = { getAllMasterJobsNames: getAllMasterJobsNames }; return service; function getAllMasterJobsNames(request) { return $http.post('/JSONServices/JSONCampusManagementService.svc/GetAllMasterJobsNames', request).then( function (response) { if (angular.isUndefined(response.data) || (angular.isDefined(response.data.IsException) && response.data .IsException)) { notifier.error('Error fetching the Active Events : ' + JSON.stringify(response)); } return response; }, function (response) { notifier.error('Error fetching the Active Events : ' + JSON.stringify(response)); return response; }); } } })(); service.js 'use strict'; describe('dashboardService', function () { var dashboardService; beforeEach(module('abc')); beforeEach(inject(function (_dashboard_) { dashboardService = _dashboard_; })); it('getAllMasterJobsNames method should defined and should return promise', function () { expect(dashboard.getAllMasterJobsNames).toBeTruthy(); expect(dashboard.getAllMasterJobsNames.name).toEqual('getAllMasterJobsNames'); expect(dashboard.getAllMasterJobsNames(0)).toEqual({$$state:{status:0}}); }); }); any one …

Member Avatar
+0 forum 0

Hello, this is my first post in this forum. I recently decided to try my hand at programming with python. I'm completely new to programming so I thought I should try some simple projects to reinforce what I've learned so far. I saw a post from 3 years ago on this forum about a unit converter that has to work with inches, feet, miles, millimeters, centimeters, meters, and kilometers, and thought it would be a good project to try. So far I've only written enough script to convert from inches to any of the units mentioned above. I've got the …

Member Avatar
Member Avatar
+0 forum 7

HI, I am writing unit test cases for silver light view model. When i am trying to mock edmx context, i am getting errors as in the screen shot. Please suggest how to solve the issue. ![9559cdb1d93cc91198a358bac62eeca5](/attachments/large/2/9559cdb1d93cc91198a358bac62eeca5.png "9559cdb1d93cc91198a358bac62eeca5") Thanks kvk

Member Avatar
+0 forum 0

Hi there, Earlier this year I had a problem with my computer. When I was using it to play games and perform other quite CPU intensive tasks it would become sluggish and laggy. Usually a restart would fix it for a while. The problem got worse and worse until it started to turn itself off when things got rough. It would do this more and more frequently and easily to the point where it wouldn't turn on. After some investigation I found that my PSU was fried so I bought another one and replaced it. Problem solved. Until now. The …

Member Avatar
Member Avatar
+0 forum 7

I was writing unit tests for half year or more at my work, hoping that I do good job. But the problem is I rarely see the benefit of them. So I don't understand, why it is good. Many of the test functions look like this - they test model functions. protected function test_get_dogs_8_subtypes() { $test_result = $this->Dogs_8_model->get_dogs_8_subtypes(); $expected_result = 'is_array'; $test_name = __FUNCTION__; $this->unit->run($test_result, $expected_result, $test_name); } I run, if there is errors they fail so ok. But they will fail when I modify them. If I don't then they will never fail. But when I modify some model …

Member Avatar
Member Avatar
+0 forum 10

Hi All, We have website on Shared hosting. I am a newbie. i have installed PHPUnit testing framework on the server. When i try to run a test case in command mode(phpunit --help), i am getting error as attached screenshot. Kindly help me in executing PHPUnit. Regards,

Member Avatar
Member Avatar
+0 forum 3

Hello guys, i need a help slightly with this project of my university. my equipment are working with some components, 1. Radius Server - MySQL - OS Linux Ubunto 12.04 or OS Microsoft WindowsServer2008 - SQLServer. 2. Router Linksys Wrt-54g 3. Other Server with certification unit, which we need manage, configure and install, beside the user will generate a valid certificate which shall be placed on the client machine for validation and thus gain access to the WLAN. with this components, we need to do the next: vThe aim is that by certifying unit (preferably a completely separate server) you …

Member Avatar
Member Avatar
+0 forum 1

So I’m working on an active directory restructuring project my manager has assigned me to do since the new company name change. Basically the meat and potatoes of it is making new OU containers in the Active Directory and throwing user, printers, computers, distribution and security group objects into their respectively named parent and child OU containers (separated by sites rather than by individual company names which it is/was originally). Last week when I tried to move a handful of computer objects into the new OU child containers I created, it knocked those computers off the domain and violated the …

Member Avatar
Member Avatar
+0 forum 3

ho how do i write unit test for the blow method public static void LoadState() { XmlTextReader TextFile = null; // program state file exist if(File.Exists(FileName)) { try { // read program state file TextFile = new XmlTextReader(FileName); // create xml serializing object XmlSerializer XmlFile = new XmlSerializer(typeof(ProgramState)); // deserialize the program state State = (ProgramState) XmlFile.Deserialize(TextFile); } catch { State = null; } // close the file if(TextFile != null) TextFile.Close(); } // we have no program state file if(State == null) { // create new default program state State = new ProgramState(); // save default SaveState(); } // …

Member Avatar
+0 forum 0

hi, i wanted to know how to i test a metho as below int32[] AT; int32AB,ab; int32[] at; public void A() { AT = at; AB = ab; return; } is this correct public void SetStaticTest1() { Int32[] AT ; Int32[] at = {1,2,3,4,5}; Int32 AB ; Int32 ab = 4; AT = at; AB = ab; Assert.Equals(AT,at); Assert.Equals(AB, ab); } this gives an fail in test can some one give me the way to do testint in C# thanks

Member Avatar
Member Avatar
+0 forum 6

Hi! I'm working with a huge software system with a lot of people being involved in the coding through many years. I'm noticing more and more that there is a lot of bad code, especially get methods here and there with huge side effects, which you totally not expect. So it crossed my mind that it would be great with a unit test that detects side effects in get methods and reports them so we can clean up that bad code. But it seems kind of difficult, you would have to analyze the code somehow and make sure that nothing …

Member Avatar
Member Avatar
+0 forum 2

I have a method that returns void. say: Public void CreateRectangle(double z, double y, IRectangle rectObj) { Vector3d recPos1 = new Vector3d() recPos1.X = 0; recPos1.Y = some double vale; Vector3d recPos2 = new Vector3d() recPos2.X = some double value; recPos2.Y = 0; rectObj.SetVectors(recPos1, recPos2); } now, in my unit test i just want to verify that SetVectors() method has been called on object rectObj. I have written a moq unit test but it fails. My method looks like this: [Test(Description = "")] public void TestCreateRectangle() { double xPos = default(double); double yPos = default(double); myClass objMyClass = new myClass(); …

Member Avatar
Member Avatar
+0 forum 1

Hi, I am working on a component based application. I have a method that does some calculation and returns nothing. say: public void DoSomething(int x, int y) { // do something } How to write testing for it. I can pass some dummy x,y values. But how and what we can Assert in the unit test project. Any help would be appreciated. Thanks. Regards

Member Avatar
Member Avatar
+0 forum 2

[B]Product[/B]: [B][COLOR="Red"]Matlab, Simulink[/COLOR][/B] [B]Problem Statement[/B]: Complex feedback loops implying usage of Unit Delay Block. At certain simulation frame calculation of required values for test generation is becoming complex. Is there a way to override the Unit Delay block output without changing the model (as I am not allowed to do so) rather by using set_param. I am using cvdata/sim/cvhtml combination for my simulation. I tried extracting all the assocaited aparameter sfor Unit Delay using [CODE]get_param(gcb,'ObjectParameters');[/CODE] but was not able to find a suitable parameter to use owing to lack of help information on each parameters. Kindly help me out if …

Member Avatar
+0 forum 0

I've created a game , somewhat like space invaders, and it looks pretty cool , very proud of what ive done. But I'm stuck on finding a way of unit testing the collision of 2 sprites and the collision between the borders and a sprite. If anyone could point me in the right direction or has any sample code of this happening that would be great!

Member Avatar
Member Avatar
+0 forum 1

Hey guys, I've been lurking around these forums for a few weeks now, and this website is by far the most helpful of any site I've visited as far as honing my newfound Python skills, and I figured it's time I jump in and ask some of the more specific questions that have been plaguing me. So here goes. I'm working on my first non-school-assigned program, just a simple unit converter, and I'm having some trouble with the raw_input() method. If I code it like the following code block, everything works fine: [code=python] def distanceConverter(dfrom, funit, dto, tunit): print dfrom …

Member Avatar
Member Avatar
+0 forum 6

Hi, For .NET developers who uses unit tests to test their code, are you suffering from regression (i.e., unit tests which fails on a regular basis)? If so, how do you face these issues? Regular debug sessions to find the problem each time a test is being failed? Some other, maybe more sophisticated approaches? I would like to hear your opinion about the following solution which can find the code changes which caused a certain unit test to fail: [URL="http://www.wisetester.com/"]Unit Testing Tool[/URL] For those of you who do suffer from regression in unit tests: 1. Would you try it if …

Member Avatar
+0 forum 0

So I started to work on my last Computer Science project for the school year, a maths tutorial application. I'm a bit stuck with displaying a form to explain a mathematical concept. I decided to make a dynamic form on run-time for each grade which then contains all the available modules for that specific grade. Then I wanted the user to select a module and click a button which will create another dynamic form containing the explanations. But then reality struck me and I realized it isn't as easy as it seems... I somehow need to be able to dynamically …

Member Avatar
Member Avatar
+0 forum 1

Write a unit conversion program that asks the user to identify the unit from which they want to convert and the unit to which they want to convert. Legal units are inches, feet, miles, millimetres, centimetres, meters, and kilometres. Convert from? Inches Convert to? Millimetres Value? 10 10 in = 254 mm can anybody help me with this program i would be grateful thanks in advance

Member Avatar
Member Avatar
+0 forum 5

I've heard rumors of this coming for awhile, but I finally saw it while browsing DaniWeb just a couple of minutes ago. A box ad that I run with a white background, which usually displays four ads, now displays three. The extra room is reserved for some text links with a bunch of keywords, similar to the link units. However, instead of opening a new window, clicking on one of the keywords dynamically refreshes the IFRAME to present the user with new ads, in addition to making room for a search field built into part of the ad box (Many …

Member Avatar
+0 forum 0

The End.