All Questions
Tagged with functional-programming unit-testing
12 questions
1
vote
2
answers
115
views
UPDATE on Newspaper Bill Calculator CLI with Python (1 of 3, Core)
Code is posted after explanation.
Due to the size of the project, this is being posted in three separate posts. This also ensures each post is more focused.
Post 2 of 3, CLI: UPDATE 1 on Newspaper ...
2
votes
1
answer
134
views
Newspaper Bill Calculator CLI with Python (1 of 3, Core)
Code is posted after explanation.
Due to the size of the project, this is being posted in three separate posts. This also ensures each post is more focused.
Post 2 of 3, CLI: Newspaper Bill ...
3
votes
0
answers
126
views
Testing a javascript function that performs side effects
Application context
I am working on a game I call "Apes and Snakes". So far the code only allows players to connect to a host using a room code and WebRTC. Players and the host send messages ...
2
votes
1
answer
109
views
This technique for functional programming, and testing functional programming
I've been playing around with functional programming and testing with jest recently.
An issue I've run into, is that it's hard to mock ES6 module exports directly. See this Stack Overflow question ...
3
votes
0
answers
50
views
Test Driven Development in JS and Sinon Stub
I am going through some TDD and BDD tutorials which guide one through implementing a simple beverage-ordering system. While I think I understand the material, I am still wondering about some ...
10
votes
1
answer
1k
views
Generate iCalendar .ics files with events for astrological aspects
I'm relatively new to Python, coming from a deep C++ background. I'm mostly looking for feedback on how to make my code more idiomatic/pythonic, but I would welcome and appreciate any and all other ...
4
votes
1
answer
1k
views
WAKE UP! CodingBat alarm clock
I'm brand new at Python, but I've been working in general at granulating my functions and being as self-readable as possible without suffering readability. This CodingBat question is a little ...
8
votes
1
answer
907
views
"Curious Numbers" (HackerRank PE 34)
I was inspired by a certain recent question to try my hand at this challenge:
Project Euler #34: Digit factorials
\$19!\$ is a curious number, as \$1!+9!=1+362880=362881\$ is divisible
by \$19\$.
...
8
votes
2
answers
1k
views
Mock/Stub out filesystem in F# for unit testing
I'm looking to do some basic verification testing on my functions that write to the filesystem.
I took a hint from here on how to mock out the filesystem using an interface, but I'm kinda bummed on ...
6
votes
1
answer
157
views
Monoalphatic and Polialphabetic cipher in Ruby
This code encrypts a text with mono-alphabetic and poli-alphabetic substitutions ciphers.
For further info see:
Mono-alphabetic/Caesar Cipher
Poli-alphabetic cipher
...
4
votes
1
answer
466
views
Is a unit test which uses LINQ to check multiple values acceptable?
I'm writing unit tests for a library which parses colors from user input (example: the user input “#f00” gives a red color; the user input “60,100%,100%” gives a yellow color, etc.)
One of the ...
4
votes
2
answers
2k
views
How do I dynamically create Python unit tests in a readable way?
I have Django unit tests that are pretty much the following format:
...