14 questions
0
votes
1
answer
44
views
Adding Moq to a test project causes a pseudo-random could not load library issue
One of my colleagues has added a test project to the master branch that includes a Moq reference. Its not even busing used at the time, simply having the reference causes the build and website to fail:...
-1
votes
1
answer
63
views
Getting the maximum Pair Wise product C++ and the output is not always right with my code
Problem to solve:
given an array or sequence of numbers the goal is to find the Max number obtained by the multiplication of some 2 numbers in that sequence.
example of inputs and outputs
Input:
2
...
5
votes
4
answers
1k
views
Test simple c# code expressions in Visual Studio
I'd like to know how should I do to test simple C# expressions
1) in Visual Studio and
2) not in debug, in design mode
Say, I want to verify what will return this code
?DateTime.ParseExact("...
1
vote
4
answers
4k
views
HackerRank challenge write a function: Test case 1 failed
this is my code for the hackerRank challenge write a function
def is_leap(year):
x=str(year)
y=int(x[-2:])
return y%4==0 or y%400==0 and y%100!=0
year = int(input())
print(is_leap(year))
...
0
votes
0
answers
75
views
How does Codeacademy work?
What to your opinion bases the mechanism behind Codeacademy? How do you use code in order to check if a few lines of code are serving a certain purpose, in a certain wanted way?
I'm not looking for a ...
1
vote
1
answer
163
views
How can I use TDD to build my little PHP framework?
I am trying to get into the good habit of testing my code, I did some exercise on the subject, but everything was so simple that, when I tried to apply what I learned on a real-world application I was ...
-1
votes
2
answers
52
views
Why are the values in my random list are always the same?
This code is for a maximum pairwise product, I've been testing it but I have come across some issues.
import sys
import random
while True:
a=int(random.randrange(1,1000000,101))
keys =[] #...
0
votes
1
answer
1k
views
Disabling right-click on images doesn't work on ipad and iphones
I use the following code to disable right click on images in my website:
//disable right click on images
$(document).ready(function(){
$(document).bind("contextmenu",function(e){
if(e....
1
vote
1
answer
199
views
Test Case and Testing Automation for Module Level Testing of Embedded C Projects
I am working on a automotive project which has different modules for different functionalities. Each module has a set of predefined APIs used to achive the functionality that it is intended for. (If ...
0
votes
0
answers
49
views
How can I resolve this code challenge?
Your challenge is to implement the game described here. Where the
description refers to picking a number, it means the computer should
pick a random number between 1 and 10.
The computer ...
2
votes
2
answers
78
views
TDD: refactoring and global regressions
While the refactoring step of test driven development should always involve another full run of tests for the given functionality, what is your approach about preventing possible regressions beyond ...
5
votes
3
answers
2k
views
PHP in command line
Using Python I can test my code in the terminal / command line by typing
python
python> print "hello world"
I would like to do this with PHP too, but when typing:
php
echo "hello world";
it does ...
5
votes
7
answers
1k
views
How to test code easily?
I'm learning Java by reading "Head First Java" and by doing all the puzzles and excercies. In the book they recommend to write TestDrive classes to test the code and clases I've written, that's one ...
1
vote
1
answer
96
views
Making C++ COM classes more test-friendly
Our code-base has a lot of COM objects, so typically we'll have something like:
//this is the IDL-generated IGetTime interface header
#include "gettime.h"
//our COM class implementation of IGetTime
...